head	1.16;
access;
symbols
	TIGRIS_1_1_0RC2:1.14
	TIGRIS_1_1_0RC1:1.14
	TIGRIS_1_1:1.14.0.4
	TIGRIS_1_0_8:1.14
	TIGRIS_1_0_8RC3:1.14
	TIGRIS_1_0_8RC2:1.14
	TIGRIS_1_0_8RC1:1.14
	TIGRIS_1_0_7:1.14
	TIGRIS_1_0_7RC3:1.14
	TIGRIS_1_0_7RC2:1.14
	TIGRIS_1_0_7RC1:1.14
	TIGRIS_1_0_6:1.14
	TIGRIS_1_0_6RC5:1.14
	TIGRIS_1_0_6RC4:1.14
	TIGRIS_1_0_6RC3:1.14
	TIGRIS_1_0_6RC2:1.14
	TIGRIS_1_0_6RC1:1.14
	TIGRIS_1_0_5:1.14
	TIGRIS_1_0_5RC6:1.14
	TIGRIS_1_0_5RC5:1.14
	TIGRIS_1_0_5RC4:1.14
	TIGRIS_1_0_5RC3:1.14
	TIGRIS_1_0_5RC2:1.14
	TIGRIS_1_0_5RC1:1.14
	TIGRIS_1_0_4:1.14
	TIGRIS_1_0_3:1.14
	TIGRIS_1_0_2:1.14
	TIGRIS_1_0_1:1.14
	TIGRIS_1_0:1.14.0.6
	TIGRIS_1_0_0:1.14
	TIGRIS_1_0_0_RC1:1.14.0.2
	TIGRIS_0_9_2_4:1.8
	TIGRIS_0_9_2_3:1.8
	HELM_PEER_PORT_BRANCH:1.10.0.2
	TURBINE_PEER:1.10
	TIGRIS_0_9_2_1:1.10
	TIGRIS_0_9_2:1.8.0.6
	TIGRIS_0_9_0:1.8.0.4
	TIGRIS_0_8_4:1.8.0.2
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1
	OLDHELM:1.5.0.4
	TIGRIS_NOV_11_2000:1.5
	TIGRIS_SEP_13_2000:1.5.0.2
	TIGRIS_BASELINE:1.5;
locks; strict;
comment	@# @;


1.16
date	2001.07.09.19.09.37;	author leonardr;	state dead;
branches;
next	1.15;

1.15
date	2001.05.23.01.50.19;	author dlr;	state Exp;
branches;
next	1.14;

1.14
date	2001.03.27.09.07.41;	author lucas;	state Exp;
branches;
next	1.13;

1.13
date	2001.03.07.01.53.26;	author lucas;	state Exp;
branches;
next	1.12;

1.12
date	2001.02.21.05.36.24;	author edk;	state Exp;
branches;
next	1.11;

1.11
date	2001.02.21.03.51.56;	author edk;	state Exp;
branches;
next	1.10;

1.10
date	2001.01.26.18.29.07;	author edk;	state Exp;
branches
	1.10.2.1;
next	1.9;

1.9
date	2001.01.26.05.24.07;	author edk;	state dead;
branches;
next	1.8;

1.8
date	2000.11.29.01.56.27;	author leonardr;	state Exp;
branches;
next	1.7;

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

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

1.5
date	2000.09.20.03.13.17;	author brian;	state Exp;
branches;
next	1.4;

1.4
date	2000.04.26.02.05.38;	author jrobbins;	state Exp;
branches;
next	1.3;

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

1.2
date	2000.03.31.12.26.17;	author jrobbins;	state Exp;
branches;
next	1.1;

1.1
date	2000.03.31.11.56.19;	author jrobbins;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.11.12.21.16.25;	author dlr;	state Exp;
branches;
next	;

1.10.2.1
date	2001.01.28.01.02.19;	author dlr;	state dead;
branches;
next	;


desc
@@


1.16
log
@Cleanup: Getting rid of fragments of nonexistant servlets.
@
text
@/* ================================================================
 * Copyright (c) 2000 Collab.Net.  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 Collab.Net (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 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 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 Collab.Net.
 */


package org.tigris.helm.publish;

import org.apache.turbine.util.Log;
import org.apache.turbine.util.TurbineException;

import org.apache.velocity.context.Context;

import org.joist.security.RedirectException;

import org.tigris.helm.security.*;
import org.tigris.helm.om.Project;

/**
  * Display an html page through the standard template.
  */
public class SecureView extends HelmServlet
{
    /**
     *  Displays the UI.
     */
    protected String processRequest(Context context)
        throws TurbineException, RedirectException
    {

        // Let the superclass do its part.
        // also sets $page and $documentRoot
        String templateName =  super.processRequest(context);

        String page = getParameter(context, "page");
        context.put("page", page);
        String projectName = "";
        projectName = getCurrentProject(context).getName();
        Log.debug("projectName=" + projectName);

        // figure out project document root
        String apacheDocRoot = getInitParameter("documentRoot");
        Log.debug("apacheDocRoot=" + apacheDocRoot);

        String projectDocRoot = apacheDocRoot + "/" + projectName + "/www";
        context.put("projectDocRoot", projectDocRoot);

        return templateName;
    }
}
@


1.15
log
@Ported Helm from WebMacro to Velocity.
@
text
@@


1.14
log
@Begone Java 1.1
@
text
@d50 6
a55 10
import java.util.*;
import java.sql.*;
import javax.servlet.http.*;
import javax.servlet.*;

import com.workingdogs.village.*;

import org.joist.database.*;
import org.joist.security.*;
import org.joist.session.*;
a58 2
import org.webmacro.util.*;
import org.webmacro.servlet.*;
a62 1

a64 3
    static private Log log = new Log("SecureView", "SecureView");
    static private boolean debug = false;
   
d66 1
a66 1
     *  Displays the html
d68 2
a69 3
	protected String
    processRequest (Connection connection, WebContext context)
            throws HandlerException, RedirectException
d72 3
a74 3
	// Let the superclass do its part.
	// also sets $page and $documentRoot
	String templateName =  super.processRequest(connection, context);
d76 2
a77 2
	String page = context.getForm("page");
	context.put("page", page);
d80 1
a80 1
        if (debug) log.info("projectName=" + projectName);
d82 3
a84 3
	// figure out project document root
	String apacheDocRoot = getInitParameter("documentRoot");
	if (debug) log.info("apacheDocRoot=" + apacheDocRoot);
d86 2
a87 2
	String projectDocRoot = apacheDocRoot + "/" + projectName + "/www";
	context.put("projectDocRoot", projectDocRoot);
d89 1
a89 1
	return templateName;
@


1.13
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@a50 1
import com.sun.java.util.collections.*;
@


1.12
log
@fix imports, exceptions, and use turbine logging
@
text
@a63 1

@


1.11
log
@we no longer need to catch exceptions when we do project.getName()
@
text
@d63 1
a63 1
import org.tigris.helm.project.Project;
@


1.10
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@d92 2
a93 9
        try 
        {
            projectName = getCurrentProject(context).getName();
            if (debug) log.info("projectName=" + projectName);
	}
        catch (DataSetException dse) {
            log.exception(dse);
            throw new HandlerException("got a DataSetException");
        }
@


1.10.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@@


1.9
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.8
log
@Apostrophe errors begone!
@
text
@@


1.7
log
@Switched some warning() calls to info() and turned off debugging.
@
text
@d85 1
a85 1
	// Let the superclass do it's part.
@


1.6
log
@Resolved merge conflicts.
@
text
@d75 1
a75 1
    static private boolean debug = true;
d95 1
a95 1
            if (debug) log.warning("projectName=" + projectName);
d104 1
a104 1
	if (debug) log.warning("apacheDocRoot=" + apacheDocRoot);
@


1.5
log
@
Obtained from:
Submitted by:
Reviewed by:

Moved from org.helm to org.tigris.helm
Moved from org/helm to org/tigris/helm

perl -pi.bak -e, how I love thee

note: this update was done POST-CVS-REPOSITORY surgury.  In order to
get this right, you may need to remove the directories

$CVSROOT/helm/java/org/helm
$CVSROOT/helm/data/htdoc/look/www/org/helm
$CVSROOT/helm/templates/org/helm

before doing the "CVS update" call, since those directories don't
exist anymore and CVS will try to create lockfiles for you in them,
giving you an error.
@
text
@d54 1
d56 3
d60 5
d72 1
a72 1
public class SecureView extends SecureServlet
d82 1
a82 1
	throws HandlerException, RedirectException
d84 1
d91 5
a95 13
	if (page.indexOf("community/") > 0) context.put("showCommunity", Boolean.TRUE);
	if (page.indexOf("news/") > 0) context.put("showNews", Boolean.TRUE);
	if (page.indexOf("tools/") > 0) context.put("showTools", Boolean.TRUE);
	
	// echo the project name into the context
	// the project argument is set in the apache RewriteRules
	String project = context.getForm("project");

	// if it is not set, try to guess it from the host name, assumes vhosting
	if (project == null || project.length() == 0) {
	    String httpAndServer = context.get("httpAndServer").toString();
	    int dot = httpAndServer.indexOf('.', 7);
	    project = httpAndServer.substring(7, dot);
d97 4
d102 1
a102 3
	if (debug) log.debug("project=" + project);
	
	// change document root to take into account virtual hosting
d104 1
a104 2
	//String apacheDocRoot = myProperties.getProperty("documentRoot");
	if (debug) log.debug("apacheDocRoot=" + apacheDocRoot);
d106 1
a106 1
	String projectDocRoot = apacheDocRoot + "/" + project + "/www";
@


1.4
log
@now if the project is specified explicitly it will use that, otherwise it will look at the vhost name
@
text
@d48 1
a48 1
package org.helm.publish;
@


1.3
log
@switched from collections2.jar to collections.jar
@
text
@d87 10
a96 3
	String httpAndServer = context.get("httpAndServer").toString();
	int dot = httpAndServer.indexOf('.', 7);
	String project = httpAndServer.substring(7, dot);
a97 2
	if (debug) log.debug("project=" + project);

@


1.2
log
@added missing context varaiable
@
text
@d51 1
@


1.1
log
@initial checkin
@
text
@d79 1
@


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
@d48 1
a48 1
package org.tigris.helm.publish;
a52 1
import javax.servlet.*;
a53 3
import com.workingdogs.village.*;

import org.joist.database.*;
a54 5
import org.joist.session.*;

import org.tigris.helm.security.*;
import org.tigris.helm.project.Project;

d62 1
a62 1
public class SecureView extends HelmServlet
d72 1
a72 1
            throws HandlerException, RedirectException
a73 1

d79 11
a89 11
	context.put("page", page);
        String projectName = "";
        try 
        {
            projectName = getCurrentProject(context).getName();
            if (debug) log.warning("projectName=" + projectName);
	}
        catch (DataSetException dse) {
            log.exception(dse);
            throw new HandlerException("got a DataSetException");
        }
d91 1
a91 1
	// figure out project document root
d93 2
a94 1
	if (debug) log.warning("apacheDocRoot=" + apacheDocRoot);
d96 1
a96 1
	String projectDocRoot = apacheDocRoot + "/" + projectName + "/www";
@


