head	1.10;
access;
symbols
	TIGRIS_1_1_0RC2:1.8
	TIGRIS_1_1_0RC1:1.8
	TIGRIS_1_1:1.8.0.4
	TIGRIS_1_0_8:1.8
	TIGRIS_1_0_8RC3:1.8
	TIGRIS_1_0_8RC2:1.8
	TIGRIS_1_0_8RC1:1.8
	TIGRIS_1_0_7:1.8
	TIGRIS_1_0_7RC3:1.8
	TIGRIS_1_0_7RC2:1.8
	TIGRIS_1_0_7RC1:1.8
	TIGRIS_1_0_6:1.8
	TIGRIS_1_0_6RC5:1.8
	TIGRIS_1_0_6RC4:1.8
	TIGRIS_1_0_6RC3:1.8
	TIGRIS_1_0_6RC2:1.8
	TIGRIS_1_0_6RC1:1.8
	TIGRIS_1_0_5:1.8
	TIGRIS_1_0_5RC6:1.8
	TIGRIS_1_0_5RC5:1.8
	TIGRIS_1_0_5RC4:1.8
	TIGRIS_1_0_5RC3:1.8
	TIGRIS_1_0_5RC2:1.8
	TIGRIS_1_0_5RC1:1.8
	TIGRIS_1_0_4:1.8
	TIGRIS_1_0_3:1.8
	TIGRIS_1_0_2:1.8
	TIGRIS_1_0_1:1.8
	TIGRIS_1_0:1.8.0.6
	TIGRIS_1_0_0:1.8
	TIGRIS_1_0_0_RC1:1.8.0.2
	TIGRIS_0_9_2_4:1.2
	TIGRIS_0_9_2_3:1.2
	HELM_PEER_PORT_BRANCH:1.7.0.2
	TURBINE_PEER:1.7
	TIGRIS_0_9_2_1:1.7
	TIGRIS_0_9_2:1.2.0.2
	TIGRIS_0_9_0:1.1.0.2;
locks; strict;
comment	@# @;


1.10
date	2001.06.06.13.48.54;	author leonardr;	state dead;
branches;
next	1.9;

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

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

1.7
date	2001.01.26.18.29.09;	author edk;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2001.01.26.05.24.08;	author edk;	state dead;
branches;
next	1.5;

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

1.4
date	2001.01.19.20.48.45;	author leonardr;	state Exp;
branches;
next	1.3;

1.3
date	2001.01.19.14.36.36;	author leonardr;	state Exp;
branches;
next	1.2;

1.2
date	2001.01.06.01.23.00;	author leonardr;	state Exp;
branches;
next	1.1;

1.1
date	2000.12.12.01.53.55;	author leonardr;	state Exp;
branches;
next	;

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


desc
@@


1.10
log
@Getting rid of unused files.
@
text
@/* ================================================================
 * Copyright (c) 2000 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.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;

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

import org.apache.velocity.context.Context;

import org.joist.*;
import org.joist.util.*;
import org.tigris.helm.tool.SessionManager;

import org.joist.security.RedirectException;
import org.joist.database.*;
import org.tigris.helm.*;
import org.tigris.helm.security.*;

/**
 * Create a new Role.
 *
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 * @@version $Id: StaticUtils.java,v 1.9 2001/05/23 01:50:21 dlr Exp $
 */
public class StaticUtils extends HelmServlet 
{
    private static String REBUILD_ACTIONS_ACTION="Rebuild Action Map";
    private static String REBUILD_ACL_ROLES_ACTION="Rebuild ACL Role Map";
    private static String REBUILD_ACL_USERGROUPS_ACTION="Rebuild ACL User Groups";
    private static String REBUILD_ACL_PROJECTGROUPS_ACTION="Rebuild ACL Project Groups";
    private static String START_TIGRIS_TASK_THREAD_ACTION="Start Tigris Task Runner";
    private static String STOP_TIGRIS_TASK_THREAD_ACTION="Stop Tigris Task Runner";

    /**
     *  Rebuild data structures and start/stop threads.
     */
    protected String processRequest(Context context)
	throws TurbineException, RedirectException
    {
	String templateName = super.processRequest(context);
        try 
        {
            String action = getAction(context);
            String message = "";

            /* HELP: FIXME: Don't know what this has turned into.
            //See if the TigrisTaskManager thread is running.
            context.put("threadRunning",
                        new Boolean(TigrisTaskRunner.numberOfInstances() > 0));

            if (action != null)
            {
                if (action.equals(REBUILD_ACTIONS_ACTION)) {
                    ActionManager.buildActionMaps(connection, dMgr);
                    message = "Action map rebuilt.";
                }
                else if (action.equals(REBUILD_ACL_ROLES_ACTION)) {
                    AccessControlList.buildActionsByRole(connection, dMgr);
                    message = "Role map rebuilt.";
                }
                else if (action.equals(REBUILD_ACL_USERGROUPS_ACTION)) {
                    AccessControlList.buildUserGroups(connection, dMgr);
                    message = "User groups rebuilt.";
                }
                else if (action.equals(REBUILD_ACL_PROJECTGROUPS_ACTION)) {
                    AccessControlList.buildProjectGroups(connection, dMgr);
                    message = "Project groups rebuilt.";
                }
                else if (action.equals(STOP_TIGRIS_TASK_THREAD_ACTION)) {
                    int i = TigrisTaskRunner.stopThreads();
                    message = new Integer(i).toString() +
                        (i == 1 ? " thread" : " threads") + " stopped.";
                    context.put("threadRunning", Boolean.FALSE);
                }
                else if (action.equals(START_TIGRIS_TASK_THREAD_ACTION)) {
                    if (TigrisTaskRunner.numberOfInstances() > 0) {
                        message = "Task runner already active.";
                    }
                    else {
                        TigrisTaskRunner tr = new TigrisTaskRunner();
                        tr.start();
                        message = "Task runner started.";
                        context.put("threadRunning", Boolean.TRUE);
                    }
                }
            }
            */

            appendToMessage(context, message, null);

        }
        catch (Exception e) {
            Log.error(e);
            throw new TurbineException(e);
        }

        return templateName;  
    }
}
@


1.9
log
@Ported Helm from WebMacro to Velocity.
@
text
@d73 1
a73 1
 * @@version $Id: StaticUtils.java,v 1.8 2001/02/21 04:44:01 dlr Exp $
@


1.8
log
@Compiles, but needs attention from Leonard.  Most the code has simply
been commented out, as this is a non-core servlet that is in the way.
@
text
@d56 1
d58 1
a58 1
import org.webmacro.servlet.*;
d62 1
a62 1
import org.joist.session.*;
d73 1
a73 1
 * @@version $Id: StaticUtils.java,v 1.7 2001/01/26 18:29:09 edk Exp $
d87 2
a88 2
    protected String processRequest (Connection connection, WebContext context)
	throws HandlerException, RedirectException
d90 1
a90 1
	String templateName = super.processRequest(connection, context);
d144 1
a144 1
            throw new HandlerException(e.getMessage());
@


1.7
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@d55 2
a56 1
import org.webmacro.util.*;
a58 1
import com.workingdogs.village.DataSetException;
d66 1
a66 2
import org.tigris.helm.database.ActionManager;
import org.tigris.helm.security.AccessControlList;
d72 1
a72 1
 * @@version $Id: StaticUtils.java,v 1.4 2001/01/19 20:48:45 leonardr Exp $
d74 1
a74 1
public class StaticUtils extends org.tigris.helm.security.HelmServlet 
a75 5
    public static final  String versionID = "$Id: StaticUtils.java,v 1.4 2001/01/19 20:48:45 leonardr Exp $";

    private static Log log = new Log("ResAdd", "Role Add Servlet");
    private static boolean debug = true;

d95 1
d97 2
a98 1
            context.put("threadRunning", new Boolean(TigrisTaskRunner.numberOfInstances() > 0));
d102 1
a102 2
                if (action.equals(REBUILD_ACTIONS_ACTION))
                {
d105 2
a106 1
                } else if (action.equals(REBUILD_ACL_ROLES_ACTION)) {
d109 2
a110 1
                } else if (action.equals(REBUILD_ACL_USERGROUPS_ACTION)) {
d113 2
a114 1
                } else if (action.equals(REBUILD_ACL_PROJECTGROUPS_ACTION)) {
d117 2
a118 1
                } else if (action.equals(STOP_TIGRIS_TASK_THREAD_ACTION)) {
d120 2
a121 1
                    message = new Integer(i).toString() + (i==1?" thread":" threads") + " stopped.";
d123 3
a125 3
                } else if (action.equals(START_TIGRIS_TASK_THREAD_ACTION)) {
                    if (TigrisTaskRunner.numberOfInstances() > 0)
                    {
d127 2
a128 1
                    } else {
d136 1
d140 3
a142 8
        } catch (DataSetException e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        } catch (SQLException e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        } catch (JoistDatabaseException e) {
            log.exception(e);
d148 1
a148 4

} /* end class StaticUtils */


@


1.7.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d73 1
a73 1
 * @@version $Id: StaticUtils.java,v 1.7 2001/01/26 18:29:09 edk Exp $
d77 1
a77 1
    public static final  String versionID = "$Id: StaticUtils.java,v 1.7 2001/01/26 18:29:09 edk Exp $";
@


1.6
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
@d73 1
a73 1
 * @@version $Id: StaticUtils.java,v 1.5 2001/01/24 20:42:49 dlr Exp $
d77 1
a77 1
    public static final  String versionID = "$Id: StaticUtils.java,v 1.5 2001/01/24 20:42:49 dlr Exp $";
d102 1
a102 2
            context.put("threadRunning",
                        new Boolean(TigrisTaskRunner.numberOfInstances() > 0));
d138 7
a144 1
        } catch (DBException e) {
d151 4
a154 1
}
@


1.5
log
@Making use of DBException.
@
text
@d73 1
a73 1
 * @@version $Id: StaticUtils.java,v 1.4 2001/01/19 20:48:45 leonardr Exp $
d77 1
a77 1
    public static final  String versionID = "$Id: StaticUtils.java,v 1.4 2001/01/19 20:48:45 leonardr Exp $";
@


1.4
log
@Also, it might be a good idea for the button constants to actually correspond to the right buttons.
@
text
@d73 1
a73 1
 * @@version $Id: StaticUtils.java,v 1.3 2001/01/19 14:36:36 leonardr Exp $
d77 1
a77 1
    public static final  String versionID = "$Id: StaticUtils.java,v 1.3 2001/01/19 14:36:36 leonardr Exp $";
d102 2
a103 1
            context.put("threadRunning", new Boolean(TigrisTaskRunner.numberOfInstances() > 0));
d139 1
a139 7
        } catch (DataSetException e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        } catch (SQLException e) {
            log.exception(e);
            throw new HandlerException(e.getMessage());
        } catch (JoistDatabaseException e) {
d146 1
a146 4

} /* end class StaticUtils */


@


1.3
log
@Oops, two buttons on StaticUtils had their functions switched.
@
text
@d73 1
a73 1
 * @@version $Id: StaticUtils.java,v 1.2 2001/01/06 01:23:00 leonardr Exp $
d77 1
a77 1
    public static final  String versionID = "$Id: StaticUtils.java,v 1.2 2001/01/06 01:23:00 leonardr Exp $";
d84 2
a85 2
    private static String REBUILD_ACL_USERGROUPS_ACTION="Rebuild ACL Project Groups";
    private static String REBUILD_ACL_PROJECTGROUPS_ACTION="Rebuild ACL User Groups";
@


1.2
log
@You can now stop and restart the TigrisTaskRunner thread from the StaticUtils servlet.
@
text
@d73 1
a73 1
 * @@version $Id: StaticUtils.java,v 1.1 2000/12/12 01:53:55 leonardr Exp $
d77 1
a77 1
    public static final  String versionID = "$Id: StaticUtils.java,v 1.1 2000/12/12 01:53:55 leonardr Exp $";
d114 1
a114 1
                    AccessControlList.buildProjectGroups(connection, dMgr);
d117 1
a117 1
                    AccessControlList.buildUserGroups(connection, dMgr);
@


1.1
log
@New servlet - StaticUtils
@
text
@d73 1
a73 1
 * @@version $Id: StaticUtils.java,v 1.2 2000/12/08 16:59:43 leonardr Exp $
d77 1
a77 1
    public static final  String versionID = "$Id: StaticUtils.java,v 1.2 2000/12/08 16:59:43 leonardr Exp $";
d86 2
d90 1
a90 1
     *  Validate data and create a new Role.
d100 4
d119 15
a133 2
                }    
                appendToMessage(context, message, null);
d135 3
@

