head	1.19;
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
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.10.2.1
	TIGRIS_0_9_2_3:1.10.2.1
	HELM_PEER_PORT_BRANCH:1.1.1.2
	TURBINE_PEER:1.12
	TIGRIS_0_9_2_1:1.12
	TIGRIS_0_9_2:1.10.0.2
	TIGRIS_0_9_0:1.6.0.2
	TIGRIS_0_8_4:1.5.0.2
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1;
locks; strict;
comment	@# @;


1.19
date	2001.08.28.17.45.17;	author leonardr;	state Exp;
branches;
next	1.18;

1.18
date	2001.08.11.09.08.06;	author dlr;	state Exp;
branches;
next	1.17;

1.17
date	2001.07.19.19.46.15;	author dlr;	state Exp;
branches;
next	1.16;

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

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

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

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

1.12
date	2001.01.26.18.29.04;	author edk;	state Exp;
branches
	1.12.2.1;
next	1.11;

1.11
date	2001.01.26.05.24.06;	author edk;	state dead;
branches;
next	1.10;

1.10
date	2001.01.23.23.01.38;	author elicia;	state Exp;
branches
	1.10.2.1;
next	1.9;

1.9
date	2001.01.16.21.19.19;	author elicia;	state dead;
branches;
next	1.8;

1.8
date	2001.01.12.22.09.10;	author elicia;	state Exp;
branches;
next	1.7;

1.7
date	2000.12.29.17.11.53;	author leonardr;	state Exp;
branches;
next	1.6;

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

1.5
date	2000.11.30.22.12.47;	author elicia;	state Exp;
branches;
next	1.4;

1.4
date	2000.11.30.03.16.04;	author elicia;	state Exp;
branches;
next	1.3;

1.3
date	2000.11.27.21.22.17;	author elicia;	state Exp;
branches;
next	1.2;

1.2
date	2000.11.22.02.18.34;	author elicia;	state Exp;
branches;
next	1.1;

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

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

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

1.10.2.1
date	2001.01.23.23.10.42;	author lucas;	state Exp;
branches;
next	;

1.12.2.1
date	2001.01.28.01.02.18;	author dlr;	state dead;
branches;
next	1.12.2.2;

1.12.2.2
date	2001.02.10.00.39.10;	author elicia;	state Exp;
branches;
next	1.12.2.3;

1.12.2.3
date	2001.02.15.20.50.42;	author leonardr;	state Exp;
branches;
next	1.12.2.4;

1.12.2.4
date	2001.02.16.03.01.34;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.19
log
@More methods migrated to ContextAPI.
@
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 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 CollabNet.
 */


package org.tigris.helm.project;

import java.io.*;
import java.util.*;
import java.sql.*;

import org.apache.turbine.util.Log;
import org.apache.commons.util.exception.NestableException;

import org.apache.velocity.context.Context;

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

public class NewsItemView extends HelmServlet
{
    private static final boolean DEBUG = true;

    /**
     *  Display and process the Login screen.
     */
    protected String processRequest(Context ctx)
        throws NestableException, RedirectException
    {
        if (DEBUG)
            Log.debug ("NewsItemView: started!");

        String templateName = super.processRequest(ctx);

        try
        {
            Project currentProject = getCurrentProject(ctx);
            String newsID = ContextAPI.getParameter(ctx, "newsID");
            NewsItem newsItem = (NewsItem)NewsItemPeer.getInstance(newsID);
            ctx.put("newsItem", newsItem);
        }
        catch (Exception e)
        {
            Log.error(e);
            String message = "NewsItemView: " + e.getMessage ();
            if (DEBUG) Log.debug (message);
            ctx.put ("message", message);
        }

        if (DEBUG)
            Log.debug ("NewsItemView:  done");

        return templateName;
    }
}
@


1.18
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@d62 1
d82 1
a82 1
            String newsID = getParameter(ctx, "newsID");
@


1.17
log
@Removed Joist references.
@
text
@d55 1
a55 1
import org.apache.turbine.util.TurbineException;
d71 1
a71 1
        throws TurbineException, RedirectException
@


1.16
log
@Ported Joist Redirect*Exception to Helm.
@
text
@a53 2
import org.apache.velocity.context.Context;

a55 2
import org.apache.turbine.util.TurbineException;
import com.workingdogs.village.*;
d57 4
a60 2
import org.joist.*;
import org.joist.util.*;
a62 7
import org.tigris.helm.security.HelmServlet;
/*
import org.tigris.helm.tool.*;
import org.tigris.helm.tool.paginate.*;
*/
import org.tigris.helm.om.*;
import org.tigris.helm.om.*;
d65 1
a65 1
  private static boolean debug = true;
d70 5
a74 5
  protected String processRequest(Context ctx)
    throws TurbineException, RedirectException
  {
    if (debug)
      Log.debug ("NewsItemView: started!");
d76 1
a76 16
    String templateName = super.processRequest(ctx);

    try
    {
       Project currentProject = getCurrentProject(ctx);
       String newsID = getParameter(ctx, "newsID");
       NewsItem newsItem = (NewsItem)NewsItemPeer.getInstance(newsID);
       ctx.put("newsItem", newsItem);
    }
    catch (Exception e)
    {
      Log.error(e);
      String message = "NewsItemView: " + e.getMessage ();
      if (debug) Log.debug (message);
      ctx.put ("message", message);
    }
d78 14
a91 2
    if (debug)
        Log.debug ("NewsItemView:  done");
d93 2
a94 2
    return templateName;
  }
d96 3
a98 1
}				/* end class NewsItem */
@


1.15
log
@Ported Helm from WebMacro to Velocity.
@
text
@d63 1
a63 1
import org.joist.security.RedirectException;
@


1.14
log
@Corrected regex madness for Torque upgrade.  -dlr
@
text
@d54 1
a54 1
import org.webmacro.servlet.*;
d57 2
d79 2
a80 2
  protected String processRequest (Connection conn, WebContext ctx)
    throws HandlerException, RedirectException
d85 1
a85 1
    String templateName = super.processRequest (conn, ctx);
d90 1
a90 1
       String newsID = ctx.getForm("newsID");
@


1.13
log
@This is the highest revision from the HELM_PEER_PORT_BRANCH.  The previous import caused too many conflicts to resolve manually
@
text
@d69 1
a69 3
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;

@


1.12
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.
a53 1
import org.webmacro.util.Log;
d56 1
d64 1
d67 4
a70 1
import org.tigris.helm.domain.NewsItem;
a73 3
  public static final String versionID =
    "$Id: NewsItemView.java,v 1.10 2001/01/23 23:01:38 elicia Exp $";
  private static Log log = new Log ("NewsItemView", "Tigris StartPage");
d77 1
a77 1
     *  Display and process the login screen.
d83 1
a83 1
      log.debug ("NewsItemView: started!");
d91 2
a92 2
       NewsItem item = new NewsItem(conn, dMgr, newsID);
       ctx.put("newsItem", item);
d96 3
a98 3
      log.exception (e);
      String message = "NewsItem: " + e.getMessage ();
      if (debug) log.debug (message);
d103 1
a103 1
        log.debug ("NewsItemView:  done");
@


1.12.2.1
log
@Porting to the Turbine Peer system.  -dlr and leonardr
@
text
@d71 1
a71 1
    "$Id: NewsItemView.java,v 1.12 2001/01/26 18:29:04 edk Exp $";
@


1.12.2.2
log
@ported to turbine
@
text
@d54 1
a56 1
import org.apache.turbine.util.Log;
a63 1
/*
d66 1
a66 3
*/
import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
d70 3
d76 1
a76 1
     *  Display and process the Login screen.
d82 1
a82 1
      Log.debug ("NewsItemView: started!");
d90 2
a91 2
       NewsItem newsItem = (NewsItem)NewsItemPeer.getInstance(newsID);
       ctx.put("newsItem", newsItem);
d95 3
a97 3
      Log.error(e);
      String message = "NewsItemView: " + e.getMessage ();
      if (debug) Log.debug (message);
d102 1
a102 1
        Log.debug ("NewsItemView:  done");
@


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


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


1.11
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.10
log
@these got deleted from the repository
@
text
@d71 1
a71 1
    "$Id: NewsItemView.java,v 1.8 2001/01/12 22:09:10 elicia Exp $";
@


1.10.2.1
log
@they are supposed to be here
@
text
@d71 1
a71 1
    "$Id: NewsItemView.java,v 1.10 2001/01/23 23:01:38 elicia Exp $";
@


1.9
log
@changed name to NewsItemApproval for consistency
@
text
@d78 1
a78 2
  protected String
    processRequest (Connection conn, WebContext context)
d84 1
a84 1
    String templateName = super.processRequest (conn, context);
d88 4
a91 20
       Project currentProject = getCurrentProject(context);
       List newsItems = currentProject.getNews(getLoginUser(context).getACL());
       String newsID = context.getForm("newsID");
          
       for (int i = 0; i < newsItems.size(); i++)
       {
	      NewsItem item = (NewsItem)newsItems.get(i);
	      if (item.getID().equals(newsID))
	          newsItems.remove(i);
       }
       newsItems.add(0, new NewsItem(conn, dMgr, newsID));

       // Next/previous links to other news items in this project
       if (newsItems.size() > 0)
       {
          context.put("newsItems",
                       Paginator.paginate(newsItems,  1, context));
       }
       
       context.put("origNewsID", newsID);
d97 2
a98 3
      if (debug)
	  log.debug (message);
      context.put ("message", message);
@


1.8
log
@minor cleanup
@
text
@d71 1
a71 1
    "$Id: NewsItemView.java,v 1.7 2000/12/29 17:11:53 leonardr Exp $";
@


1.7
log
@Many, many pagination changes.
@
text
@d71 1
a71 1
    "$Id: NewsItemView.java,v 1.6 2000/12/14 03:09:59 leonardr Exp $";
d95 3
a97 3
	  NewsItem item = (NewsItem)newsItems.get(i);
	  if (item.getID().equals(newsID))
	      newsItems.remove(i);
a117 1

@


1.6
log
@Moved paginator stuff to its own directory.
@
text
@d71 1
a71 1
    "$Id: NewsItemView.java,v 1.5 2000/11/30 22:12:47 elicia Exp $";
d90 1
a90 1
       List newsItems = currentProject.getNews();
@


1.5
log
@display news when there is only 1
@
text
@d65 1
d71 1
a71 1
    "$Id: NewsItemView.java,v 1.4 2000/11/30 03:16:04 elicia Exp $";
@


1.4
log
@re-ordering list of news items so that the current item is at the top of the stack. this will allow us to next/prev through the stack.
@
text
@d70 1
a70 1
    "$Id: NewsItemView.java,v 1.3 2000/11/27 21:22:17 elicia Exp $";
a99 1

d101 1
a101 1
       if (newsItems.size() > 1)
@


1.3
log
@added pagination
@
text
@a64 1
import org.tigris.helm.database.ProjectNewsManager;
d70 1
a70 1
    "$Id: NewsItemView.java,v 1.2 2000/11/22 02:18:34 elicia Exp $";
d82 1
a82 1
      log.debug ("NewsItem: started!");
a85 4
    ProjectNewsManager newsMgr = (ProjectNewsManager)
      getDataManager (context).getManager
      ("org.tigris.helm.database.ProjectNewsManager");

d89 12
a100 1
       List newsItemList = currentProject.getNews();
d102 1
a102 1
       if (newsItemList.size() > 0)
d105 1
a105 1
            Paginator.paginate(newsItemList, 1, context));
d107 2
d121 1
a121 1
        log.debug ("NewsItem:  done");
@


1.2
log
@modernized files--using NewsItem business object
@
text
@d64 1
d71 1
a71 1
    "$Id: NewsItemView.java,v 1.1.1.1 2000/11/12 21:15:52 dlr Exp $";
a85 1
    String action = (String) context.get ("action");
a90 8
    String newsID = context.getForm ("newsID");
    String headline;
    String event_date;
    String body;

    if (debug)
        log.debug ("NewsItem: action=" + action);

d93 8
a100 2
      NewsItem newsItem = new NewsItem(conn, dMgr, newsID);
      context.put("newsItem", newsItem);
@


1.1
log
@Initial revision
@
text
@d70 1
a70 1
    "$Id: NewsItemView.java,v 1.3 2000/11/08 04:10:58 elicia Exp $";
d78 1
a78 1
    processRequest (Connection connection, WebContext context)
d84 1
a84 1
    String templateName = super.processRequest (connection, context);
d101 2
a102 11
      DataSet newsItemSet = newsMgr.getNewsItem(connection, newsID);
      if (!newsItemSet.containsRecord(0))
      {
         appendToMessage(context, "News item does not exist.");
      } else 
      {
         Record r = newsItemSet.getRecord(0);
         NewsItem newsItem = new NewsItem(connection, dMgr, r);
         context.put("newsItem", newsItem);
      }
      
@


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.
d54 1
a56 1
import org.apache.turbine.util.Log;
d64 2
a65 7
/*
import org.tigris.helm.tool.*;
import org.tigris.helm.tool.paginate.*;
*/
import org.tigris.helm.om.*;
import org.tigris.helm.om.peer.*;
import org.tigris.helm.om.base.*;
d69 3
d75 1
a75 1
     *  Display and process the Login screen.
d77 2
a78 1
  protected String processRequest (Connection conn, WebContext ctx)
d82 1
a82 1
      Log.debug ("NewsItemView: started!");
d84 14
a97 1
    String templateName = super.processRequest (conn, ctx);
d101 11
a111 4
       Project currentProject = getCurrentProject(ctx);
       String newsID = ctx.getForm("newsID");
       NewsItem newsItem = (NewsItem)NewsItemPeer.getInstance(newsID);
       ctx.put("newsItem", newsItem);
d115 5
a119 4
      Log.error(e);
      String message = "NewsItemView: " + e.getMessage ();
      if (debug) Log.debug (message);
      ctx.put ("message", message);
d122 1
d124 1
a124 1
        Log.debug ("NewsItemView:  done");
@

