head	1.10;
access;
symbols
	TIGRIS_1_1_0RC2:1.7
	TIGRIS_1_1_0RC1:1.7
	TIGRIS_1_1:1.7.0.4
	TIGRIS_1_0_8:1.7
	TIGRIS_1_0_8RC3:1.7
	TIGRIS_1_0_8RC2:1.7
	TIGRIS_1_0_8RC1:1.7
	TIGRIS_1_0_7:1.7
	TIGRIS_1_0_7RC3:1.7
	TIGRIS_1_0_7RC2:1.7
	TIGRIS_1_0_7RC1:1.7
	TIGRIS_1_0_6:1.7
	TIGRIS_1_0_6RC5:1.7
	TIGRIS_1_0_6RC4:1.7
	TIGRIS_1_0_6RC3:1.7
	TIGRIS_1_0_6RC2:1.7
	TIGRIS_1_0_6RC1:1.7
	TIGRIS_1_0_5:1.7
	TIGRIS_1_0_5RC6:1.7
	TIGRIS_1_0_5RC5:1.7
	TIGRIS_1_0_5RC4:1.7
	TIGRIS_1_0_5RC3:1.7
	TIGRIS_1_0_5RC2:1.7
	TIGRIS_1_0_5RC1:1.7
	TIGRIS_1_0_4:1.7
	TIGRIS_1_0_3:1.7
	TIGRIS_1_0_2:1.7
	TIGRIS_1_0_1:1.7
	TIGRIS_1_0:1.7.0.6
	TIGRIS_1_0_0:1.7
	TIGRIS_1_0_0_RC1:1.7.0.2
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.3
	TIGRIS_0_9_2_3:1.3
	HELM_PEER_PORT_BRANCH:1.1.1.2
	TURBINE_PEER:1.5
	TIGRIS_0_9_2_1:1.5
	TIGRIS_0_9_2:1.3.0.6
	TIGRIS_0_9_0:1.3.0.4
	TIGRIS_0_8_4:1.3.0.2
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1;
locks; strict;
comment	@# @;


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

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

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

1.7
date	2001.03.07.01.53.26;	author lucas;	state Exp;
branches;
next	1.6;

1.6
date	2001.02.21.01.08.24;	author dlr;	state Exp;
branches;
next	1.5;

1.5
date	2001.01.26.18.29.07;	author edk;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	2001.01.26.05.24.07;	author edk;	state dead;
branches;
next	1.3;

1.3
date	2000.11.29.12.38.18;	author jrobbins;	state Exp;
branches;
next	1.2;

1.2
date	2000.11.29.00.00.05;	author stack;	state Exp;
branches;
next	1.1;

1.1
date	2000.11.12.21.16.24;	author dlr;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.11.12.21.16.24;	author dlr;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2001.02.21.00.35.08;	author dlr;	state Exp;
branches;
next	;

1.5.2.1
date	2001.01.28.01.02.19;	author dlr;	state dead;
branches;
next	1.5.2.2;

1.5.2.2
date	2001.02.20.04.10.25;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.10
log
@Avoid unnecessary fully qualified package names where not absolutely
necessary.
@
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" or 
 * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without 
 * prior written permission of Collab.Net.
 * 
 * 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 Collab.Net.
 */ 
package org.tigris.helm.publish;

import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

import org.apache.velocity.context.Context;

import org.tigris.helm.om.Project;

/**
 * NoodleData is a per-request container of commonly used items.
 *
 * This subclass adds a webmacro context to the container so 
 * filters for HelmNoodle have access to all that is in context.
 * In particular, what has been added by HelmServlet (permissions
 * checking, user info, etc.). 
 *
 * @@author <a href="mailto:stack@@collab.net">St.Ack</a>
 * @@version $Id: HelmNoodleData.java,v 1.9 2001/07/17 00:35:39 dlr Exp $
 */
public class HelmNoodleData extends NoodleData
{
    /**
     * The template context.
     */
    private Context context = null;
    
    private boolean transformFlag = false;
    
    /**
     * The template context can be used to get the 
     * HttpServletRequest and HttpServletResponse but
     * so what. Add what i need in this subclass and leave 
     * the class parents in peace.
     * 
     * @@param inReq The http servlet request object.
     * @@param inRes The http servlet response object.
     * @@param inContext Current requests template context.
     */
    public HelmNoodleData( HttpServletRequest inReq, 
                           HttpServletResponse inRes,
                           Context inContext )
    {
        super( inReq, inRes );
        this.context = inContext;
    }
    
    
    /**
     * Setter for template context.
     * @@param inContext Context to set.
     */
    public void setContext( Context inContext )
    {
        context = inContext;
    }
    
    
    /**
     * Accessor for the template context.
     * @@return The template context.
     */
    public Context getContext( )
    {
        return context;
    }

    public String postProcessPageName (String page) {
        if (!transformFlag) return page;
        Object p = context.get("currentProject");
        if (p instanceof Project) {
            String projectName = ((Project)p).getName();
            page = "/local-access-only/" + projectName + "/www/" + page;
        }
        return page;
    }

    public void setPageTransforming(boolean flag)
    {
        transformFlag = flag;
    }
}
@


1.9
log
@Subclassed Helm class (rather than Joist), and corrected misc. build
errors.
@
text
@d65 1
a65 1
 * @@version $Id: HelmNoodleData.java,v 1.8 2001/05/23 01:50:19 dlr Exp $
d87 2
a88 2
                            HttpServletResponse inRes,
                            org.apache.velocity.context.Context inContext )
d99 1
a99 1
    public void setContext( org.apache.velocity.context.Context inContext )
d109 1
a109 1
    public org.apache.velocity.context.Context getContext( )
@


1.8
log
@Ported Helm from WebMacro to Velocity.
@
text
@d52 2
d55 1
d65 1
a65 1
 * @@version $Id: HelmNoodleData.java,v 1.7 2001/03/07 01:53:26 lucas Exp $
d67 1
a67 2
public class HelmNoodleData
    extends org.joist.publish.NoodleData
d70 1
a70 1
     * The WebMacro context.
d72 1
a72 1
    private org.apache.velocity.context.Context context = null;
d77 1
a77 1
     * The webmacro context can be used to get the 
d84 1
a84 1
     * @@param inContext Current requests webmacro context.
d96 1
a96 1
     * Setter for webmacro context.
d106 2
a107 2
     * Accessor for the webmacro context.
     * @@return The webmacro context.
@


1.7
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d62 1
a62 1
 * @@version $Id: HelmNoodleData.java,v 1.6 2001/02/21 01:08:24 dlr Exp $
d70 1
a70 1
    private org.webmacro.servlet.WebContext context = null;
d86 1
a86 1
                            org.webmacro.servlet.WebContext inContext )
d97 1
a97 1
    public void setContext( org.webmacro.servlet.WebContext inContext )
d107 1
a107 1
    public org.webmacro.servlet.WebContext getContext( )
@


1.6
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@a52 1

d62 1
a62 1
 * @@version $Id: HelmNoodleData.java,v 1.5.2.2 2001/02/20 04:10:25 dlr Exp $
@


1.5
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@d2 1
a2 1
 * Copyright (c) 2000 Collab.Net.  All rights reserved.
d17 1
a17 1
 * software developed by Collab.Net <http://www.Collab.Net/>."
d32 1
a32 1
 * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
a47 1

d52 1
a52 2
import org.tigris.helm.project.Project;
import com.workingdogs.village.DataSetException;
d54 11
a64 10
/** NoodleData is a per-request container of commonly used items.
*
* This subclass adds a webmacro context to the container so 
* filters for HelmNoodle have access to all that is in context.
* In particular, what has been added by HelmServlet (permissions
* checking, user info, etc.). 
*
* @@author <a href="mailto:stack@@collab.net">St.Ack</a>
* @@version $Id: HelmNoodleData.java,v 1.3 2000/11/29 12:38:18 jrobbins Exp $
*/
d68 4
a71 10
    /** Class version string
    */
    private static final String versionID 
        = "$Id: HelmNoodleData.java,v 1.3 2000/11/29 12:38:18 jrobbins Exp $";


    /** The WebMacro context.
    */
    private org.webmacro.servlet.WebContext context = 
        null;
d75 10
a84 11
    /** Constructor.
    *
    * The webmacro context can be used to get the 
    * HttpServletRequest and HttpServletResponse but
    * so what. Add what i need in this subclass and leave 
    * the class parents in peace.
    * 
    * @@param inReq The http servlet request object.
    * @@param inRes The http servlet response object.
    * @@param inContext Current requests webmacro context.
    */
d94 4
a97 3
    /** Setter for webmacro context.
    * @@param inContext Context to set.
    */
d104 4
a107 3
    /** Accessor for the webmacro context.
    * @@return The webmacro context.
    */
a116 1
            try {
a118 5
            }
            catch (DataSetException dse) {
                // do nothing
                // TODO: log it!
            }
@


1.5.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d64 1
a64 1
* @@version $Id: HelmNoodleData.java,v 1.5 2001/01/26 18:29:07 edk Exp $
d72 1
a72 1
        = "$Id: HelmNoodleData.java,v 1.5 2001/01/26 18:29:07 edk Exp $";
@


1.5.2.2
log
@Ported from HEAD.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d17 1
a17 1
 * software developed by CollabNet <http://www.collab.net/>."
d32 1
a32 1
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
d48 1
d53 2
a54 1
import org.tigris.helm.om.Project;
d56 10
a65 11
/**
 * NoodleData is a per-request container of commonly used items.
 *
 * This subclass adds a webmacro context to the container so 
 * filters for HelmNoodle have access to all that is in context.
 * In particular, what has been added by HelmServlet (permissions
 * checking, user info, etc.). 
 *
 * @@author <a href="mailto:stack@@collab.net">St.Ack</a>
 * @@version $Id: HelmNoodleData.java,v 1.5 2001/01/26 18:29:07 edk Exp $
 */
d69 10
a78 4
    /**
     * The WebMacro context.
     */
    private org.webmacro.servlet.WebContext context = null;
d82 11
a92 10
    /**
     * The webmacro context can be used to get the 
     * HttpServletRequest and HttpServletResponse but
     * so what. Add what i need in this subclass and leave 
     * the class parents in peace.
     * 
     * @@param inReq The http servlet request object.
     * @@param inRes The http servlet response object.
     * @@param inContext Current requests webmacro context.
     */
d102 3
a104 4
    /**
     * Setter for webmacro context.
     * @@param inContext Context to set.
     */
d111 3
a113 4
    /**
     * Accessor for the webmacro context.
     * @@return The webmacro context.
     */
d123 1
d126 5
@


1.4
log
@revert this stuff to its state as of 2001/01/24 12:42:00 GMT -- with
the following exceptions, which have some different modifications so
they'll work with changes which have happened in joist:

ProjectNewsEdit.java
SkinManager.java
SkinStyleElementValueManager.java
StyleElementManager.java
StyleManager.java

it compiles.  i dunno if it works, though.
@
text
@@


1.3
log
@added ContentHelmNoodle and all of its associated files, also had to add a hook for ProxyModule to transform page name and support for alternative master templates
@
text
@d64 1
a64 1
* @@version $Id: HelmNoodleData.java,v 1.2 2000/11/29 00:00:05 stack Exp $
d72 1
a72 1
        = "$Id: HelmNoodleData.java,v 1.2 2000/11/29 00:00:05 stack Exp $";
@


1.2
log
@Get current context after crossing the TLogin divide.  Was using context from before TLogin request.  Also, copious notes on issues w/ the way i'm storing across TLogin redirects
@
text
@d53 2
d64 1
a64 1
* @@version $Id: HelmNoodleData.java,v 1.1.1.1 2000/11/12 21:16:24 dlr Exp $
d72 1
a72 1
        = "$Id: HelmNoodleData.java,v 1.1.1.1 2000/11/12 21:16:24 dlr Exp $";
d80 1
d117 21
@


1.1
log
@Initial revision
@
text
@d62 1
a62 1
* @@version $Id: HelmNoodleData.java,v 1.2 2000/10/27 01:25:52 stack Exp $
d70 1
a70 1
        = "$Id: HelmNoodleData.java,v 1.2 2000/10/27 01:25:52 stack Exp $";
d96 9
@


1.1.1.1
log
@Merging newhelm tree into helm, as per IZ issue #557.  Previous major version of helm is tagged TIGRIS_NOV_11_2000.
@
text
@@


1.1.1.2
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d17 1
a17 1
 * software developed by CollabNet <http://www.collab.net/>."
d32 1
a32 1
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
d48 1
a52 1
import org.tigris.helm.om.Project;
d54 10
a63 11
/**
 * NoodleData is a per-request container of commonly used items.
 *
 * This subclass adds a webmacro context to the container so 
 * filters for HelmNoodle have access to all that is in context.
 * In particular, what has been added by HelmServlet (permissions
 * checking, user info, etc.). 
 *
 * @@author <a href="mailto:stack@@collab.net">St.Ack</a>
 * @@version $Id: HelmNoodleData.java,v 1.5.2.2 2001/02/20 04:10:25 dlr Exp $
 */
d67 23
a89 17
    /**
     * The WebMacro context.
     */
    private org.webmacro.servlet.WebContext context = null;
    
    private boolean transformFlag = false;
    
    /**
     * The webmacro context can be used to get the 
     * HttpServletRequest and HttpServletResponse but
     * so what. Add what i need in this subclass and leave 
     * the class parents in peace.
     * 
     * @@param inReq The http servlet request object.
     * @@param inRes The http servlet response object.
     * @@param inContext Current requests webmacro context.
     */
d99 3
a101 14
    /**
     * Setter for webmacro context.
     * @@param inContext Context to set.
     */
    public void setContext( org.webmacro.servlet.WebContext inContext )
    {
        context = inContext;
    }
    
    
    /**
     * Accessor for the webmacro context.
     * @@return The webmacro context.
     */
a104 15
    }

    public String postProcessPageName (String page) {
        if (!transformFlag) return page;
        Object p = context.get("currentProject");
        if (p instanceof Project) {
            String projectName = ((Project)p).getName();
            page = "/local-access-only/" + projectName + "/www/" + page;
        }
        return page;
    }

    public void setPageTransforming(boolean flag)
    {
        transformFlag = flag;
@

