head	1.26;
access;
symbols
	TIGRIS_1_1_0RC2:1.17
	TIGRIS_1_1_0RC1:1.17
	TIGRIS_1_1:1.17.0.4
	TIGRIS_1_0_8:1.17
	TIGRIS_1_0_8RC3:1.17
	TIGRIS_1_0_8RC2:1.17
	TIGRIS_1_0_8RC1:1.17
	TIGRIS_1_0_7:1.17
	TIGRIS_1_0_7RC3:1.17
	TIGRIS_1_0_7RC2:1.17
	TIGRIS_1_0_7RC1:1.17
	TIGRIS_1_0_6:1.17
	TIGRIS_1_0_6RC5:1.17
	TIGRIS_1_0_6RC4:1.17
	TIGRIS_1_0_6RC3:1.17
	TIGRIS_1_0_6RC2:1.17
	TIGRIS_1_0_6RC1:1.17
	TIGRIS_1_0_5:1.17
	TIGRIS_1_0_5RC6:1.17
	TIGRIS_1_0_5RC5:1.17
	TIGRIS_1_0_5RC4:1.17
	TIGRIS_1_0_5RC3:1.17
	TIGRIS_1_0_5RC2:1.17
	TIGRIS_1_0_5RC1:1.17
	TIGRIS_1_0_4:1.17
	TIGRIS_1_0_3:1.17
	TIGRIS_1_0_2:1.17
	TIGRIS_1_0_1:1.17
	TIGRIS_1_0:1.17.0.6
	TIGRIS_1_0_0:1.17
	TIGRIS_1_0_0_RC1:1.17.0.2
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.6
	TIGRIS_0_9_2_3:1.6
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.9
	TIGRIS_0_9_2_1:1.9
	TIGRIS_0_9_2:1.6.0.2
	TIGRIS_0_9_0:1.4.0.4
	TIGRIS_0_8_4:1.4.0.2;
locks; strict;
comment	@# @;


1.26
date	2001.07.23.23.58.55;	author leonardr;	state dead;
branches;
next	1.25;

1.25
date	2001.07.19.00.50.13;	author dlr;	state Exp;
branches;
next	1.24;

1.24
date	2001.07.18.10.05.12;	author dlr;	state Exp;
branches;
next	1.23;

1.23
date	2001.07.17.17.55.45;	author leonardr;	state Exp;
branches;
next	1.22;

1.22
date	2001.06.06.07.40.35;	author ms;	state Exp;
branches;
next	1.21;

1.21
date	2001.06.05.19.06.54;	author ms;	state Exp;
branches;
next	1.20;

1.20
date	2001.05.23.01.50.09;	author dlr;	state Exp;
branches;
next	1.19;

1.19
date	2001.05.21.20.37.57;	author ms;	state Exp;
branches;
next	1.18;

1.18
date	2001.05.10.01.44.35;	author ms;	state Exp;
branches;
next	1.17;

1.17
date	2001.03.23.20.10.29;	author leonardr;	state Exp;
branches;
next	1.16;

1.16
date	2001.03.14.19.14.08;	author dlr;	state Exp;
branches;
next	1.15;

1.15
date	2001.03.07.01.53.20;	author lucas;	state Exp;
branches;
next	1.14;

1.14
date	2001.03.02.23.01.07;	author ms;	state Exp;
branches;
next	1.13;

1.13
date	2001.02.27.01.48.20;	author dlr;	state Exp;
branches;
next	1.12;

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

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

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

1.9
date	2001.01.26.18.29.02;	author edk;	state Exp;
branches
	1.9.2.1;
next	1.8;

1.8
date	2001.01.26.05.24.05;	author edk;	state dead;
branches;
next	1.7;

1.7
date	2001.01.25.02.52.28;	author ms;	state Exp;
branches;
next	1.6;

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

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

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

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

1.2
date	2000.11.23.09.46.34;	author dlr;	state Exp;
branches;
next	1.1;

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

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

1.9.2.1
date	2001.01.28.01.02.17;	author dlr;	state dead;
branches;
next	1.9.2.2;

1.9.2.2
date	2001.02.08.01.39.49;	author dlr;	state Exp;
branches;
next	1.9.2.3;

1.9.2.3
date	2001.02.15.20.50.35;	author leonardr;	state Exp;
branches;
next	1.9.2.4;

1.9.2.4
date	2001.02.16.03.01.26;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.26
log
@Got rid of ugly multi-page project add in favor of lovely single-page project add. Those adjectives are not subjective in any way.
@
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 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 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.domain;

import java.util.*;
import java.sql.*;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import javax.servlet.*;
import javax.servlet.http.*;

import org.apache.turbine.util.*;

import org.apache.velocity.context.Context;

import org.tigris.helm.*;
import org.tigris.helm.om.*;
import org.tigris.helm.security.*;
import org.tigris.helm.tool.DBFlag;
import org.tigris.helm.tool.ContextAPI;
import org.tigris.helm.tool.SessionManager;
import org.tigris.helm.tool.TagValidator;

/**
 * The first step in adding a new project.  Fill out project information.
 *
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@author <a href="mailto:leonardr@@collab.net">Leonard Richardson</a>
 */
public class ProjectAddStep1 extends ProjectAdd
{
    /**
     * Display and process the project addition information.
     */
    protected String processRequest(Context context)
        throws TurbineException, RedirectException 
    {
        String templateName = super.processRequest(context);
        HttpSession session = getSessionManager(context).getSession();

        String action = getAction(context);
        Log.debug("action=" + action);

        String newProjectName = ContextAPI.processRequiredField
            (context, PROJECT_NAME, session, "Project name");
        String shortDescription = ContextAPI.processRequiredField
            (context, SHORT_DESCRIP, session, "Short description");
        String longDescription = ContextAPI.processField
            (context, LONG_DESCRIP, session);
        String useIndex = ContextAPI.processField
            (context, USE_INDEX, session);
        String url = ContextAPI.processField(context, URL, session);

        try
        {
            User loginUser = getLoginUser(context);
            String userID = loginUser.getID();
            
            Domain currentDomain = getCurrentDomain(context);
            TagValidator tagger = new TagValidator();
            
            if (tagger.containsHTML(shortDescription))
            {
                context.put(SHORT_DESCRIP, 
                            TagValidator.escapeHTML(shortDescription));
                ContextAPI.addValidationError(context, "Summary contains HTML");
            }
            
            if (!tagger.validate(longDescription,
                                 TagValidator.TEXT_FORMAT_TAGS))
            {
                context.put(LONG_DESCRIP, 
                            TagValidator.escapeHTML(longDescription));
                ContextAPI.addValidationError
                    (context, "Invalid HTML or Javascript in Description");
            }
            
            if (tagger.containsHTML(newProjectName))
            {
                context.put(PROJECT_NAME, TagValidator.escapeHTML(newProjectName));
                ContextAPI.addValidationError
                    (context, "Project name contains HTML");
            }
            
            if (NEXT_STEP.equals(action))
            {
                if (haveValue(newProjectName) &&
                    !Project.isValidName(newProjectName))
                {
                    ContextAPI.addValidationError
                        (context, 
                         "You specified an invalid project name. Please read" +
                         " the guidelines beneath the \"Project Name\" field.");
                }
                try
                {
                    Project.assertNonexistance(currentDomain, newProjectName);
                }
                catch (AlreadyExists e)
                {
                    ContextAPI.addValidationError
                        (context, "Project name already exists.");
                }
                
                if (ContextAPI.isValidUserInput(context))
                {                   
                    session.putValue(PROJECT_NAME, newProjectName);
                    session.putValue(SHORT_DESCRIP, shortDescription);
                    session.putValue(USE_INDEX, useIndex);
                    session.putValue(LONG_DESCRIP, longDescription);
                    session.putValue(URL, url);
                    
                    redirectToNextStep(context);
                }
                
            }
            else if (PREV_STEP.equals(action))
            {
                redirectToPreviousStep(context);
            }
        }
        catch (RedirectException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            Log.error(e);
            throw new TurbineException(e);
        }
        return templateName;
    }
}
@


1.25
log
@Removed Joist dependancies.
@
text
@@


1.24
log
@Ported Joist Redirect*Exception to Helm.
@
text
@a59 4
import org.joist.util.TagValidator;
import org.tigris.helm.tool.SessionManager;
import org.tigris.helm.security.RedirectException;

d65 2
@


1.23
log
@Porting of domain package to new error handling API.
@
text
@d62 1
a62 1
import org.joist.security.RedirectException;
@


1.22
log
@fixed silly error and took dlr's recommendation to remove early return
@
text
@d68 1
d81 1
a81 1
    protected String processRequest(Context ctx)
d84 2
a85 2
        String templateName = super.processRequest(ctx);
        HttpSession session = getSessionManager(ctx).getSession();
d87 1
a87 1
        String action = getAction(ctx);
d90 9
a98 2
        List missingFields = new ArrayList();
        List validationErrors = new ArrayList();
d100 1
a100 10
        String newProjectName = processField(ctx, PROJECT_NAME, session, 
                                             "Project name", missingFields);
        String shortDescription = processField(ctx, SHORT_DESCRIP,
                                               session,
                                               "Short description",
                                               missingFields);
        String longDescription = processField(ctx, LONG_DESCRIP, session);
        String useIndex = processField(ctx, USE_INDEX, session);
        String url = processField(ctx, URL, session);
        if (!action.equals("none"))
d102 7
a108 1
            try
d110 4
a113 2
                User loginUser = getLoginUser(ctx);
                String userID = loginUser.getID();
d115 8
a122 2
                Domain currentDomain = getCurrentDomain(ctx);
                TagValidator tagger = new TagValidator();
d124 11
a134 1
                if (tagger.containsHTML(shortDescription))
d136 4
a139 3
                    ctx.put(SHORT_DESCRIP, 
                            TagValidator.escapeHTML(shortDescription));
                    validationErrors.add("Summary contains HTML");
d141 1
a141 2
                if (!tagger.validate(longDescription,
                                     TagValidator.TEXT_FORMAT_TAGS))
d143 1
a143 3
                    ctx.put(LONG_DESCRIP, 
                            TagValidator.escapeHTML(longDescription));
                    validationErrors.add("Invalid HTML or Javascript in Description");
d145 1
a145 1
                if (tagger.containsHTML(newProjectName))
d147 2
a148 2
                    ctx.put(PROJECT_NAME, TagValidator.escapeHTML(newProjectName));
                    validationErrors.add("Project name contains HTML");
d150 10
a159 38

                if (action != null && action.equals(NEXT_STEP))
                {
                    if (haveValue(newProjectName) &&
                        !Project.isValidName(newProjectName))
                    {
                        validationErrors.add
                            ("You specified an invalid project name. Please read" +
                             " the guidelines beneath the \"Project Name\" field.");
                    }
                    try
                    {
                        Project.assertNonexistance(currentDomain, newProjectName);
                    }
                    catch (AlreadyExists e)
                    {
                        validationErrors.add("Project name already exists.");
                    }
                    if (isValidUserInput(missingFields, validationErrors))
                    {                   
                        session.putValue(PROJECT_NAME, newProjectName);
                        session.putValue(SHORT_DESCRIP, shortDescription);
                        session.putValue(USE_INDEX, useIndex);
                        session.putValue(LONG_DESCRIP, longDescription);
                        session.putValue(URL, url);

                        redirectToNextStep(ctx);
                    }
                    else
                    {
                        // Report missing fields and validation errors.
                        reportInvalidUserInput(ctx, missingFields, 
                                               validationErrors); 
                    }
                }
                else if (action != null && action.equals(PREV_STEP))
                {
                    redirectToPreviousStep(ctx);
d161 1
d163 1
a163 1
            catch (RedirectException e)
d165 1
a165 6
                throw e;
            }
            catch (Exception e)
            {
                Log.error(e);
                throw new TurbineException(e);
d167 9
@


1.21
log
@dont process data if not action
@
text
@a87 4
        try
        {
            User loginUser = getLoginUser(ctx);
            String userID = loginUser.getID();
d89 2
a90 3
            // Gather any user input, adding it to the context as well.
            List missingFields = new ArrayList();
            List validationErrors = new ArrayList();
d92 15
a106 9
            String newProjectName = processField(ctx, PROJECT_NAME, session, 
                                                 "Project name", missingFields);
            String shortDescription = processField(ctx, SHORT_DESCRIP,
                                                   session,
                                                   "Short description",
                                                   missingFields);
            String longDescription = processField(ctx, LONG_DESCRIP, session);
            String useIndex = processField(ctx, USE_INDEX, session);
            String url = processField(ctx, URL, session);
d108 2
a109 6
            if (action == "none")
            {
                return templateName;
            }
            Domain currentDomain = getCurrentDomain(ctx);
            TagValidator tagger = new TagValidator();
d111 1
a111 23
            if (tagger.containsHTML(shortDescription))
            {
                ctx.put(SHORT_DESCRIP, 
                        TagValidator.escapeHTML(shortDescription));
                validationErrors.add("Summary contains HTML");
            }

            if (!tagger.validate(longDescription, TagValidator.TEXT_FORMAT_TAGS))
            {
                ctx.put(LONG_DESCRIP, 
                        TagValidator.escapeHTML(longDescription));
                validationErrors.add("Invalid HTML or Javascript in Description");
            }
            if (tagger.containsHTML(newProjectName))
            {
                ctx.put(PROJECT_NAME, TagValidator.escapeHTML(newProjectName));
                validationErrors.add("Project name contains HTML");
            }

            if (action != null && action.equals(NEXT_STEP))
            {
                if (haveValue(newProjectName) &&
                    !Project.isValidName(newProjectName))
d113 3
a115 3
                    validationErrors.add
                        ("You specified an invalid project name. Please read" +
                         " the guidelines beneath the \"Project Name\" field.");
d117 2
a118 1
                try
d120 3
a122 1
                    Project.assertNonexistance(currentDomain, newProjectName);
d124 1
a124 1
                catch (AlreadyExists e)
d126 2
a127 1
                    validationErrors.add("Project name already exists.");
d130 33
a162 9
                if (isValidUserInput(missingFields, validationErrors))
                {                   
                    session.putValue(PROJECT_NAME, newProjectName);
                    session.putValue(SHORT_DESCRIP, shortDescription);
                    session.putValue(USE_INDEX, useIndex);
                    session.putValue(LONG_DESCRIP, longDescription);
                    session.putValue(URL, url);

                    redirectToNextStep(ctx);
d164 1
a164 1
                else
d166 1
a166 3
                    // Report missing fields and validation errors.
                    reportInvalidUserInput(ctx, missingFields, 
                                           validationErrors); 
d169 5
a173 1
            else if (action != null && action.equals(PREV_STEP))
d175 2
a176 1
                redirectToPreviousStep(ctx);
a177 9
        }
        catch (RedirectException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            Log.error(e);
            throw new TurbineException(e);
@


1.20
log
@Ported Helm from WebMacro to Velocity.
@
text
@d106 5
a110 1

d138 3
a140 1
                    validationErrors.add("You specified an invalid project name. Please read the guidelines beneath the \"Project Name\" field.");
d165 1
a165 1
                                           validationErrors);
a181 1

@


1.19
log
@used description from helm
@
text
@d58 1
a58 1
import org.webmacro.servlet.*;
d61 1
a61 1
import org.joist.session.SessionManager;
d80 2
a81 2
    protected String processRequest (Connection conn, WebContext ctx)
        throws HandlerException, RedirectException 
d83 1
a83 1
        String templateName = super.processRequest(conn, ctx);
d174 1
a174 1
            throw new HandlerException(e.getMessage());
@


1.18
log
@changing to new api
@
text
@a107 1

a117 1

@


1.17
log
@Put in error message pointing to the project guidelines for people who type in project names without looking at the guidelines underneath the box.
@
text
@a87 1

d95 2
d109 3
a111 2
            List validationErrors = new ArrayList();
            if (TagValidator.containsHTML(shortDescription))
d117 3
a119 1
            if (!TagValidator.validate(longDescription))
d125 1
a125 2

            if (TagValidator.containsHTML(newProjectName))
a129 1

@


1.16
log
@No longer check the Use Index box behind the user's back.  If the user
desires no description, that's what they're gonna get.
@
text
@d134 1
a134 1
                    validationErrors.add("Project name is invalid.");
@


1.15
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@a144 6
                // Default project description to using the index.
                if (!haveValue(longDescription) && !haveValue(useIndex))
                {
                    useIndex = DBFlag.ON;
                }

@


1.14
log
@check for html and javascript in user input. reports errors if existing
@
text
@a65 2
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;
@


1.13
log
@This should actually throw a HandlerException.  Rather than trying to
deal with displaying the error message itself, make use of the super
classes instead.
@
text
@d60 1
d111 20
@


1.12
log
@Improved error messaging and removed unnecessary special "Error" query
string parameter check.
@
text
@d161 1
a161 1
            appendToError(ctx, e.getMessage());
@


1.11
log
@rename projectName to newProjectName to avoid conflicts with HelmServlet's
heuristics for determining the current project
@
text
@a94 10
            // If we are returning to this page as a result of an
            // error, we just want to refresh the display, without
            // doing any further action.
            String errorMessage = (String) ctx.get("Error");
            if (errorMessage != null)
            {
                action = null;
                appendToMessage(ctx, errorMessage);
            }

@


1.10
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@d107 2
a108 2
            String projectName = processField(ctx, PROJECT_NAME, session, 
                                              "Project name", missingFields);
d122 2
a123 2
                if (haveValue(projectName) &&
                    !Project.isValidName(projectName))
d129 1
a129 1
                    Project.assertNonexistance(currentDomain, projectName);
d144 1
a144 1
                    session.putValue(PROJECT_NAME, projectName);
@


1.9
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.
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
d56 2
a57 1
import org.webmacro.util.*;
a59 4
import com.workingdogs.village.*;

import org.joist.*;
import org.joist.util.*;
d63 4
a66 2
import org.tigris.helm.AlreadyExists;
import org.tigris.helm.database.*;
a67 1
import org.tigris.helm.project.*;
a77 20
    public static final  String versionID = "$Id: ProjectAddStep1.java,v 1.6 2000/12/29 21:17:35 dlr Exp $";

    /**
     * Open the log file.
     */
    private static Log log = new Log("prjAdd1", "ProjectAddStep1");

    /**
     * Whether to log debugging information.
     */
    private static boolean debug = true;

    /**
     * Called on servlet startup by the servlet container.
     */
    public void start () throws ServletException
    {
        super.start();
    }

d79 1
a79 1
     * Display and process the project addition request.
d88 1
a88 1
        if (debug) log.info("action=" + action);
d129 1
a129 3
                    Project.assertNonexistance(conn, dMgr, 
                                               currentDomain.getID(),
                                               projectName);
d170 2
a171 4
            log.exception(e);
            String message = e.getMessage();
            if (debug) log.debug(message);
            appendToMessage(ctx, message);
@


1.9.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d80 1
a80 1
    public static final  String versionID = "$Id: ProjectAddStep1.java,v 1.9 2001/01/26 18:29:02 edk Exp $";
@


1.9.2.2
log
@The first step in adding a new project.  Fill out project information.
@
text
@d17 1
a17 1
 * software developed by Collab.Net (http://www.collab.net/)."
d32 1
a32 1
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
d56 2
a57 1
import org.apache.turbine.util.*;
d59 1
a59 1
import org.webmacro.servlet.*;
d61 2
d66 2
a67 3
import org.tigris.helm.*;
import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
d69 1
d80 20
d101 1
a101 1
     * Display and process the project addition information.
d110 1
a110 1
        Log.debug("action=" + action);
d151 3
a153 1
                    Project.assertNonexistance(currentDomain, projectName);
d194 4
a197 2
            Log.error(e);
            appendToError(ctx, e.getMessage());
@


1.9.2.3
log
@Normalized copyright dates.
@
text
@d2 1
a2 1
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
@


1.9.2.4
log
@Added new imports necessitated by Torque.
@
text
@a65 1
import org.tigris.helm.om.base.*;
@


1.8
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
@d80 1
a80 1
    public static final  String versionID = "$Id: ProjectAddStep1.java,v 1.7 2001/01/25 02:52:28 ms Exp $";
d131 5
a135 16
            String shortDescription = processField(ctx, SHORT_DESCRIP, session,
                                                   "Short description", 
						   missingFields);
	    String longDescription = processField(ctx, LONG_DESCRIP, session);
            List validationErrors = new ArrayList();
	    if (TagValidator.containsHTML(shortDescription))
            {
		ctx.put(SHORT_DESCRIP, TagValidator.escapeHTML(shortDescription));
		validationErrors.add("Summary contains HTML");
	    }
	    if (!TagValidator.validate(longDescription))
   	    {
		ctx.put(LONG_DESCRIP, TagValidator.escapeHTML(longDescription));
		validationErrors.add("Invalid HTML or Javascript in Description");
	    }

d138 1
d140 2
d144 1
a144 6
                if (TagValidator.containsHTML(projectName))
		{
		    ctx.put(PROJECT_NAME, TagValidator.escapeHTML(projectName));
		    validationErrors.add("Project name contains HTML");
		}
		else if(haveValue(projectName) &&
a148 1
		
d159 1
d165 1
d178 1
@


1.7
log
@Integrated TagValidator with the form-input in the servlets so that when a
form says "no html here" it actually checks the input for html, and if it allows HTML then checks it for some releative sanity.
These changes require you to update joist also for changes in TagValidator.
@
text
@d80 1
a80 1
    public static final  String versionID = "$Id: ProjectAddStep1.java,v 1.6 2000/12/29 21:17:35 dlr Exp $";
@


1.6
log
@Word marks are now supported.
@
text
@d80 1
a80 1
    public static final  String versionID = "$Id: ProjectAddStep1.java,v 1.5 2000/12/29 02:37:09 dlr Exp $";
d131 16
a146 5
            String shortDescription = processField(ctx, SHORT_DESCRIP,
                                                   session,
                                                   "Short description",
                                                   missingFields);
            String longDescription = processField(ctx, LONG_DESCRIP, session);
a148 1

a149 2

            List validationErrors = new ArrayList();
d152 6
a157 1
                if (haveValue(projectName) &&
d162 1
a172 1

a177 1

a189 1
                    // Report missing fields and validation errors.
@


1.5
log
@Updated to support new HELM_PROJECT.USE_INDEX field (may make use of new DBFlag class to do so).
@
text
@d80 1
a80 1
    public static final  String versionID = "$Id: ProjectAddStep1.java,v 1.4 2000/11/27 20:46:07 dlr Exp $";
a130 1
            projectName = projectName.toLowerCase();
d134 1
a134 1
                                                   missingFields);    
@


1.4
log
@Corrected build errors.
@
text
@d70 1
d80 1
a80 1
    public static final  String versionID = "$Id: ProjectAddStep1.java,v 1.3 2000/11/27 20:04:12 dlr Exp $";
d136 2
a137 3
            String longDescription = processField(ctx, LONG_DESCRIP,
                                                  session, "Long description", 
                                                  missingFields);
d145 2
a146 1
                if (projectName != null && !Project.isValidName(projectName))
d161 6
d171 1
@


1.3
log
@Modifications to make project addition more wizard-like...small breakage on this commit, will fix immediatly.
@
text
@d79 1
a79 1
    public static final  String versionID = "$Id: ProjectAddStep1.java,v 1.2 2000/11/23 09:46:34 dlr Exp $";
d176 1
a176 1
            else if (action != null && action.equals(NEXT_PREV))
@


1.2
log
@Make use of the new overloads to HelmServlet's processField().
@
text
@d79 1
a79 1
    public static final  String versionID = "$Id: ProjectAddStep1.java,v 1.1 2000/11/23 09:10:02 dlr Exp $";
d102 1
a102 1
    protected String processRequest (Connection conn, WebContext context)
d105 2
a106 2
        String templateName = super.processRequest(conn, context);
        HttpSession session = getSessionManager(context).getSession();
d108 2
a109 2
        String action = (String)context.get("action");
        if (debug) log.info("action=" + action );
d113 1
a113 1
            User loginUser = getLoginUser(context);
a114 2
            String loginID = loginUser.getLoginID();
            context.put("loginID", loginID);
d119 1
a119 1
            String errorMessage = (String) context.get("Error");
d123 1
a123 1
                appendToMessage(context, errorMessage);
d128 1
a128 1
            String projectName = processField(context, PROJECT_NAME, session, 
d131 1
a131 1
            String shortDescription = processField(context, SHORT_DESCRIP,
d135 1
a135 1
            String longDescription = processField(context, LONG_DESCRIP,
d138 1
a138 1
            String url = processField(context, URL, session);
d140 1
a140 1
            Domain currentDomain = getCurrentDomain(context);
d167 1
a167 3
                    // Send the user to the next project addition step.
                    redirectToURL(context, 
                                  myProperties.getProperty("nextStep"));
d172 1
a172 1
                    reportInvalidUserInput(context, missingFields, 
d176 4
a179 1

d190 1
a190 1
            appendToMessage(context, message);
@


1.1
log
@Renamed from ProjectAdd to ProjectAddStep1 to make a nice happy
family.
@
text
@d79 1
a79 1
    public static final  String versionID = "$Id: ProjectAddStep1.java,v 1.9 2000/11/23 06:26:26 dlr Exp $";
d130 1
a130 2
            String projectName = processField(context, PROJECT_NAME, 
                                              session.getValue(PROJECT_NAME), 
d133 8
a140 9
            String shortDescription =
                processField(context, SHORT_DESCRIP,
                             session.getValue(SHORT_DESCRIP), 
                             "Short description", missingFields);    
            String longDescription =
                processField(context, LONG_DESCRIP,
                             session.getValue(LONG_DESCRIP),
                             "Long description", missingFields);
            String url = processField(context, URL, session.getValue(URL));
@


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.
d17 1
a17 1
 * software developed by Collab.Net (http://www.collab.net/)."
d32 1
a32 1
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
d56 2
a57 1
import org.apache.turbine.util.*;
d59 1
a59 1
import org.webmacro.servlet.*;
d61 2
d66 2
a67 4
import org.tigris.helm.*;
import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;
d69 1
a69 1
import org.tigris.helm.tool.DBFlag;
d79 7
d87 1
a87 1
     * Display and process the project addition information.
d89 14
a102 1
    protected String processRequest (Connection conn, WebContext ctx)
d105 2
a106 2
        String templateName = super.processRequest(conn, ctx);
        HttpSession session = getSessionManager(ctx).getSession();
d108 2
a109 2
        String action = getAction(ctx);
        Log.debug("action=" + action);
d113 1
a113 1
            User loginUser = getLoginUser(ctx);
d115 2
d121 1
a121 1
            String errorMessage = (String) ctx.get("Error");
d125 1
a125 1
                appendToMessage(ctx, errorMessage);
d130 2
a131 1
            String projectName = processField(ctx, PROJECT_NAME, session, 
d133 10
a142 7
            String shortDescription = processField(ctx, SHORT_DESCRIP,
                                                   session,
                                                   "Short description",
                                                   missingFields);
            String longDescription = processField(ctx, LONG_DESCRIP, session);
            String useIndex = processField(ctx, USE_INDEX, session);
            String url = processField(ctx, URL, session);
d144 1
a144 1
            Domain currentDomain = getCurrentDomain(ctx);
d149 1
a149 2
                if (haveValue(projectName) &&
                    !Project.isValidName(projectName))
d155 3
a157 1
                    Project.assertNonexistance(currentDomain, projectName);
a163 6
                // Default project description to using the index.
                if (!haveValue(longDescription) && !haveValue(useIndex))
                {
                    useIndex = DBFlag.ON;
                }

a167 1
                    session.putValue(USE_INDEX, useIndex);
d171 3
a173 1
                    redirectToNextStep(ctx);
d178 1
a178 1
                    reportInvalidUserInput(ctx, missingFields, 
d182 1
a182 4
            else if (action != null && action.equals(PREV_STEP))
            {
                redirectToPreviousStep(ctx);
            }
d190 4
a193 2
            Log.error(e);
            appendToError(ctx, e.getMessage());
@


