head	1.14;
access;
symbols
	TIGRIS_1_1_0RC2:1.4.6.2
	TIGRIS_1_1_0RC1:1.4.6.2
	TIGRIS_1_1:1.4.6.2.0.2
	TIGRIS_1_0_8:1.4.6.2
	TIGRIS_1_0_8RC3:1.4.6.2
	TIGRIS_1_0_8RC2:1.4.6.2
	TIGRIS_1_0_8RC1:1.4.6.2
	TIGRIS_1_0_7:1.4.6.2
	TIGRIS_1_0_7RC3:1.4.6.2
	TIGRIS_1_0_7RC2:1.4.6.2
	TIGRIS_1_0_7RC1:1.4.6.2
	TIGRIS_1_0_6:1.4.6.2
	TIGRIS_1_0_6RC5:1.4.6.2
	TIGRIS_1_0_6RC4:1.4.6.2
	TIGRIS_1_0_6RC3:1.4.6.2
	TIGRIS_1_0_6RC2:1.4.6.1
	TIGRIS_1_0_6RC1:1.4.6.1
	TIGRIS_1_0_5:1.4
	TIGRIS_1_0_5RC6:1.4
	TIGRIS_1_0_5RC5:1.4
	TIGRIS_1_0_5RC4:1.4
	TIGRIS_1_0_5RC3:1.4
	TIGRIS_1_0_5RC2:1.4
	TIGRIS_1_0_5RC1:1.4
	TIGRIS_1_0_4:1.4
	TIGRIS_1_0_3:1.4
	TIGRIS_1_0_2:1.4
	TIGRIS_1_0_1:1.4
	TIGRIS_1_0:1.4.0.6
	TIGRIS_1_0_0:1.4
	TIGRIS_1_0_0_RC1:1.4.0.2
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.1
	TIGRIS_0_9_2_3:1.1
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.3
	TIGRIS_0_9_2_1:1.3
	TIGRIS_0_9_2:1.1.0.2;
locks; strict;
comment	@# @;


1.14
date	2001.07.30.19.29.57;	author leonardr;	state dead;
branches;
next	1.13;

1.13
date	2001.07.30.18.40.41;	author leonardr;	state Exp;
branches;
next	1.12;

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

1.11
date	2001.07.17.20.10.49;	author leonardr;	state Exp;
branches;
next	1.10;

1.10
date	2001.06.18.22.12.21;	author leonardr;	state Exp;
branches;
next	1.9;

1.9
date	2001.06.11.21.55.16;	author leonardr;	state Exp;
branches;
next	1.8;

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

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

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

1.5
date	2001.04.27.21.20.21;	author leonardr;	state Exp;
branches;
next	1.4;

1.4
date	2001.02.21.01.08.23;	author dlr;	state Exp;
branches
	1.4.6.1;
next	1.3;

1.3
date	2001.01.26.18.29.04;	author edk;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	2001.01.26.05.24.06;	author edk;	state dead;
branches;
next	1.1;

1.1
date	2001.01.09.17.15.10;	author leonardr;	state Exp;
branches
	1.1.1.1;
next	;

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

1.3.2.1
date	2001.01.28.01.02.18;	author dlr;	state dead;
branches;
next	1.3.2.2;

1.3.2.2
date	2001.02.15.19.22.25;	author leonardr;	state Exp;
branches;
next	1.3.2.3;

1.3.2.3
date	2001.02.15.20.50.42;	author leonardr;	state Exp;
branches;
next	;

1.4.6.1
date	2001.05.24.23.31.10;	author leonardr;	state Exp;
branches;
next	1.4.6.2;

1.4.6.2
date	2001.06.11.22.03.30;	author leonardr;	state Exp;
branches;
next	;


desc
@@


1.14
log
@Stop coddling IZ in terms of user accounts; assume that IZ can get its permissions from Helm through the XML-RPC interface.
@
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.project;

import java.sql.Connection;
import java.util.*;

import org.apache.velocity.context.Context;

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

import org.tigris.helm.security.RedirectException;

import org.tigris.helm.om.*;
import org.tigris.helm.security.*;
import org.tigris.helm.tool.ContextAPI;

/**
 * Rebuild issue tracking accounts for a project.
 *
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 * @@version $Id: IssueTrackingRebuild.java,v 1.13 2001/07/30 18:40:41 leonardr Exp $
 */
public class IssueTrackingRebuild extends HelmServlet 
{
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.13 2001/07/30 18:40:41 leonardr Exp $";

    private static boolean DEBUG = true;

    private static String REBUILD_ACCOUNTS_ACTION="Rebuild Issue Tracking Accounts";
    private static String WHICH_PROJECTS_TO_REBUILD_FIELD="toRebuild";
    private static String REBUILD_THIS_PROJECT="this";
    private static String REBUILD_DOMAIN_PROJECTS="domain";
    private static String REBUILD_HOST_PROJECTS="host";
    
    /**
     * Rebuild issue tracking accounts for this project, all projects
     * in the domain, or all projects on the host.
     */
    protected String processRequest(Context context)
	throws TurbineException, RedirectException
    {
	String templateName = super.processRequest(context);
        
        try 
        {
            String action = getAction(context);
            String message = "";

            Project currentProject = getCurrentProject(context);
            Domain currentDomain = getCurrentDomain(context);
            AccessControlList acl = getACL(context);

            if (action != null)
            {
                if (action.equals(REBUILD_ACCOUNTS_ACTION))
                {
                    String type = ContextAPI.processField
                        (context, WHICH_PROJECTS_TO_REBUILD_FIELD, 
                         REBUILD_THIS_PROJECT);

                    Project affected = currentProject;
                    if (type.equals(REBUILD_DOMAIN_PROJECTS) 
                        && acl.hasPermission
                        ("Role - Grant", currentDomain))
                    {
                        affected = currentDomain;
                    }
                    
                    if (type.equals(REBUILD_HOST_PROJECTS) && 
                        acl.hasPermission("Role - Grant"))
                    {
                        affected = ProjectPeer.getHost();
                    }
                    affected.runCreationScripts(getCurrentUser(context));
                    affected.rebuildIssueTracking();
                    ContextAPI.addMessage(context, "Rebuild initiated.");
                }
            }           

        }
        catch (RedirectException e) 
        {
            throw e;
        } 
        catch (Exception e) 
        {
            Log.error("Exception thrown in IssueTrackingRebuild: ", e);
            throw new TurbineException(e);
        }

        return templateName;  
    }

} /* end class IssueTrackingRebuild */


@


1.13
log
@Action cleanup. Some role actions, and Audit Log - View, had three actions apiece when one would do. We're now down to 76 actions.
@
text
@d69 1
a69 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.12 2001/07/18 10:05:14 dlr Exp $
d73 1
a73 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.12 2001/07/18 10:05:14 dlr Exp $";
@


1.12
log
@Ported Joist Redirect*Exception to Helm.
@
text
@d69 1
a69 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.11 2001/07/17 20:10:49 leonardr Exp $
d73 1
a73 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.11 2001/07/17 20:10:49 leonardr Exp $";
d112 1
a112 1
                        ("Project Role - Grant", currentDomain))
d118 1
a118 1
                        acl.hasPermission("Project Role - Grant"))
@


1.11
log
@Ported servlets to new error-handling mechanism.
@
text
@d59 1
a59 1
import org.joist.security.RedirectException;
d69 1
a69 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.10 2001/06/18 22:12:21 leonardr Exp $
d73 1
a73 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.10 2001/06/18 22:12:21 leonardr Exp $";
@


1.10
log
@Huge patch of the day: Got rid of redundant HELM_DOMAIN table. The project representation of the domain and the host is now the canonical one. Host and Domain now subclass ProjectGroup. The canonical representation of a project's membership in a domain group is now the corresponding mapping in HELM_PROJECT_PROJECTGROUP. Schema changes: No more HELM_DOMAIN table (obviously); no more DOMAIN_ID in HELM_PROJECT; HELM_USER and HELM_VC_VIEW now have foreign keys in HELM_PROJECT instead of HELM_DOMAIN.
@
text
@d63 1
d69 1
a69 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.9 2001/06/11 21:55:16 leonardr Exp $
d73 1
a73 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.9 2001/06/11 21:55:16 leonardr Exp $";
d105 1
a105 1
                    String type = processField
d124 1
a124 1
                    appendToMessage(context, "Rebuild initiated.");
d126 1
a126 3
            }
            
            appendToMessage(context, message, null);
d128 3
a130 1
        } catch (RedirectException e) {
d132 3
a134 1
        } catch (Exception e) {
@


1.9
log
@run creation scripts in addition to rebuilding issue tracking.
@
text
@d68 1
a68 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.8 2001/06/01 19:22:55 leonardr Exp $
d72 1
a72 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.8 2001/06/01 19:22:55 leonardr Exp $";
d113 1
a113 1
                        affected = currentDomain.getSpecialProject();
d119 1
a119 1
                        affected = currentDomain.getHost().getSpecialProject();
@


1.8
log
@Got rid of IssueTrackingRebuild task for good.
@
text
@d68 1
a68 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.7 2001/05/23 01:50:15 dlr Exp $
d72 1
a72 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.7 2001/05/23 01:50:15 dlr Exp $";
d121 1
@


1.7
log
@Ported Helm from WebMacro to Velocity.
@
text
@d68 1
a68 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.6 2001/05/08 02:34:45 leonardr Exp $
d72 1
a72 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.6 2001/05/08 02:34:45 leonardr Exp $";
d121 1
a121 1
                    HelmTask.rebuildIssueTracking(affected);
@


1.6
log
@Rebuild issue tracking on system time, not on user time.
@
text
@d53 1
a53 1
import org.webmacro.servlet.*;
d56 2
d68 1
a68 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.5 2001/04/27 21:20:21 leonardr Exp $
d72 1
a72 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.5 2001/04/27 21:20:21 leonardr Exp $";
d86 2
a87 2
    protected String processRequest (Connection connection, WebContext context)
	throws HandlerException, RedirectException
d89 1
a89 1
	String templateName = super.processRequest(connection, context);
d132 1
a132 1
            throw new HandlerException(e.getMessage());
@


1.5
log
@Rethrow redirect exceptions.
@
text
@d66 1
a66 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.4 2001/02/21 01:08:23 dlr Exp $
d70 1
a70 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.4 2001/02/21 01:08:23 dlr Exp $";
d119 1
a119 1
                    affected.rebuildIssueTracking(acl);
@


1.4
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@d66 1
a66 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.3.2.3 2001/02/15 20:50:42 leonardr Exp $
d70 1
a70 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.3.2.3 2001/02/15 20:50:42 leonardr Exp $";
d125 3
@


1.4.6.1
log
@Ported task running system in from HEAD.
@
text
@d66 1
a66 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.4 2001/02/21 01:08:23 dlr Exp $
d70 1
a70 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.4 2001/02/21 01:08:23 dlr Exp $";
d119 1
a119 1
                    affected.rebuildIssueTracking();
@


1.4.6.2
log
@Ported issue tracking rebuild enhancements over to branch.
@
text
@d66 1
a66 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.4.6.1 2001/05/24 23:31:10 leonardr Exp $
d70 1
a70 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.4.6.1 2001/05/24 23:31:10 leonardr Exp $";
a118 1
                    affected.runCreationScripts(getCurrentUser(context));
@


1.3
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 CollabNet.  All rights reserved.
d50 1
a51 3
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
a52 1
import org.webmacro.util.*;
d55 2
d58 3
a60 5
import org.joist.database.*;
import org.tigris.helm.*;
import org.tigris.helm.project.Project;
import org.tigris.helm.domain.*;
import org.tigris.helm.security.AccessControlList;
d66 1
a66 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.1 2001/01/09 17:15:10 leonardr Exp $
d68 1
a68 1
public class IssueTrackingRebuild extends org.tigris.helm.security.HelmServlet 
d70 1
a70 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.1 2001/01/09 17:15:10 leonardr Exp $";
d72 1
a72 2
    private static Log log = new Log("ITSync", "Issue Tracking Sync Servlet");
    private static boolean debug = true;
d79 1
a79 1

d96 1
a96 1
            AccessControlList acl = getLoginUser(context).getACL();
d102 3
a104 1
                    String type = processField(context, WHICH_PROJECTS_TO_REBUILD_FIELD, REBUILD_THIS_PROJECT);
d107 3
a109 2
                    if (type.equals(REBUILD_DOMAIN_PROJECTS) && acl.hasPermissionForDomain
                        ("Project Role - Grant", currentDomain.getID()))
d113 3
a115 3

                    if (type.equals(REBUILD_HOST_PROJECTS) && acl.hasPermissionForHost
                        ("Project Role - Grant"))
d123 1
a123 1

d126 1
@


1.3.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d69 1
a69 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.3 2001/01/26 18:29:04 edk Exp $
d73 1
a73 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.3 2001/01/26 18:29:04 edk Exp $";
@


1.3.2.2
log
@Ported IssueTrackingRebuild servlet.
@
text
@d2 1
a2 1
 * Copyright (c) 2001 CollabNet.  All rights reserved.
a49 1
import java.sql.Connection;
d51 3
d55 1
a57 2
import org.apache.turbine.util.Log;

d59 5
a63 3

import org.tigris.helm.om.*;
import org.tigris.helm.security.*;
d71 1
a71 1
public class IssueTrackingRebuild extends HelmServlet 
d75 2
a76 1
    private static boolean DEBUG = true;
d83 1
a83 1
    
d100 1
a100 1
            AccessControlList acl = getACL(context);
d106 1
a106 3
                    String type = processField
                        (context, WHICH_PROJECTS_TO_REBUILD_FIELD, 
                         REBUILD_THIS_PROJECT);
d109 2
a110 3
                    if (type.equals(REBUILD_DOMAIN_PROJECTS) 
                        && acl.hasPermission
                        ("Project Role - Grant", currentDomain))
d114 3
a116 3
                    
                    if (type.equals(REBUILD_HOST_PROJECTS) && 
                        acl.hasPermission("Project Role - Grant"))
d124 1
a124 1
            
a126 1
            Log.error("Exception thrown in IssueTrackingRebuild: ", e);
@


1.3.2.3
log
@Normalized copyright dates.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
d66 1
a66 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.3.2.2 2001/02/15 19:22:25 leonardr Exp $
d70 1
a70 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.3.2.2 2001/02/15 19:22:25 leonardr Exp $";
@


1.2
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.1
log
@New servlet and support for same: IssueTrackingRebuild
@
text
@d69 1
a69 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.2 2001/01/06 01:23:00 leonardr Exp $
d73 1
a73 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.2 2001/01/06 01:23:00 leonardr Exp $";
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
a49 1
import java.sql.Connection;
d51 3
d55 1
a57 2
import org.apache.turbine.util.Log;

d59 5
a63 3

import org.tigris.helm.om.*;
import org.tigris.helm.security.*;
d69 1
a69 1
 * @@version $Id: IssueTrackingRebuild.java,v 1.3.2.3 2001/02/15 20:50:42 leonardr Exp $
d71 1
a71 1
public class IssueTrackingRebuild extends HelmServlet 
d73 1
a73 1
    public static final  String versionID = "$Id: IssueTrackingRebuild.java,v 1.3.2.3 2001/02/15 20:50:42 leonardr Exp $";
d75 2
a76 1
    private static boolean DEBUG = true;
d83 1
a83 1
    
d100 1
a100 1
            AccessControlList acl = getACL(context);
d106 1
a106 3
                    String type = processField
                        (context, WHICH_PROJECTS_TO_REBUILD_FIELD, 
                         REBUILD_THIS_PROJECT);
d109 2
a110 3
                    if (type.equals(REBUILD_DOMAIN_PROJECTS) 
                        && acl.hasPermission
                        ("Project Role - Grant", currentDomain))
d114 3
a116 3
                    
                    if (type.equals(REBUILD_HOST_PROJECTS) && 
                        acl.hasPermission("Project Role - Grant"))
d124 1
a124 1
            
a126 1
            Log.error("Exception thrown in IssueTrackingRebuild: ", e);
@


