head	1.13;
access;
symbols
	TIGRIS_0_9_2_4:1.9
	TIGRIS_0_9_2_3:1.9
	HELM_PEER_PORT_BRANCH:1.12.0.2
	TURBINE_PEER:1.12
	TIGRIS_0_9_2_1:1.12
	TIGRIS_0_9_2:1.9.0.2
	TIGRIS_0_9_0:1.7.0.2
	TIGRIS_0_8_4:1.6.0.2
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1;
locks; strict;
comment	@# @;


1.13
date	2001.03.09.22.41.37;	author leonardr;	state dead;
branches;
next	1.12;

1.12
date	2001.01.26.18.29.05;	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.25.01.13.48;	author leonardr;	state Exp;
branches;
next	1.9;

1.9
date	2000.12.30.05.03.39;	author elicia;	state Exp;
branches;
next	1.8;

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

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

1.6
date	2000.11.23.04.07.59;	author elicia;	state Exp;
branches;
next	1.5;

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

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

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

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

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

1.1.1.1
date	2000.11.12.21.16.14;	author dlr;	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.09.22.08.54;	author elicia;	state Exp;
branches;
next	1.12.2.3;

1.12.2.3
date	2001.02.09.23.46.55;	author dlr;	state dead;
branches;
next	;


desc
@@


1.13
log
@ProjectNews is now ProjectNewsList.
@
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 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.
 *
 m ====================================================================
 * 
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CollabNet.
 */


package org.tigris.helm.project;

import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;

import org.webmacro.util.*;
import org.webmacro.servlet.*;

import org.tigris.helm.security.HelmServlet;
import org.joist.security.RedirectException;


public class ProjectNews extends HelmServlet
{
  public static final String versionID =
    "$Id: ProjectNews.java,v 1.12 2001/01/26 18:29:05 edk Exp $";
  private static Log log = new Log ("ProjectNews", "Tigris ProjectNews");
  private static boolean debug = true;

  /**
   * Display servlet only--no logic.
   */
  protected String processRequest (Connection connection, WebContext context)
    throws HandlerException, RedirectException
  {
    String templateName = super.processRequest (connection, context);
    return templateName;
  }

} /* end class ProjectNews */
@


1.12
log
@readding all the files as part of the process of returning to the way
things were as of tuesday
@
text
@d65 1
a65 1
    "$Id: ProjectNews.java,v 1.9 2000/12/30 05:03:39 elicia Exp $";
@


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


1.12.2.2
log
@ported servlet
@
text
@d50 8
d59 2
d64 15
@


1.12.2.3
log
@Deprecated.
@
text
@@


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
@d65 1
a65 1
    "$Id: ProjectNews.java,v 1.10 2001/01/25 01:13:48 leonardr Exp $";
d68 12
a79 1
}
@


1.10
log
@Removed unnecessary pass through.
@
text
@d65 1
a65 1
    "$Id: ProjectNews.java,v 1.9 2000/12/30 05:03:39 elicia Exp $";
@


1.9
log
@minor cleanup
@
text
@d65 1
a65 1
    "$Id: ProjectNews.java,v 1.8 2000/12/29 17:11:53 leonardr Exp $";
d68 1
a68 12

  /**
   * Display servlet only--no logic.
   */
  protected String processRequest (Connection connection, WebContext context)
    throws HandlerException, RedirectException
  {
    String templateName = super.processRequest (connection, context);
    return templateName;
  }

} /* end class ProjectNews */
@


1.8
log
@Many, many pagination changes.
@
text
@a50 1
import java.util.Date;
a53 2
import java.util.ArrayList;
import java.util.List;
a56 3
import org.webmacro.engine.*;
import org.webmacro.broker.*;
import org.webmacro.resource.*;
a57 8
import org.joist.*;
import org.joist.util.*;
import org.joist.session.*;

import com.workingdogs.village.*;
import org.tigris.helm.domain.NewsItem;
import org.tigris.helm.tool.*;
import org.tigris.helm.tool.paginate.*;
a58 1
import org.tigris.helm.database.ProjectNewsManager;
a59 1
import org.tigris.helm.security.AccessControlList;
d61 2
a62 1
public class ProjectNews extends org.tigris.helm.security.HelmServlet
d65 1
a65 1
    "$Id: ProjectNews.java,v 1.7 2000/12/14 03:09:59 leonardr Exp $";
@


1.7
log
@Moved paginator stuff to its own directory.
@
text
@d80 1
a80 1
    "$Id: ProjectNews.java,v 1.6 2000/11/23 04:07:59 elicia Exp $";
d85 1
a85 2
   * The properties file key used to retrieve the number of users to display
   * per page.
d87 1
a87 5
  private static final String NEWS_ITEMS_PER_PAGE = "nbrNewsItemsPerPage";


  protected String
    processRequest (Connection connection, WebContext context)
a89 3
    if (debug)
      log.debug ("ProjectNews: started!");

a90 25
    Project currentProject = getCurrentProject(context);
   
    try
    {
       List newsItemList = currentProject.getNews();

       // Pagination 
       if (newsItemList.size() > 0)
       {
         int nbrNewsItemsPerPage =
            Integer.parseInt(myProperties.getProperty(NEWS_ITEMS_PER_PAGE));
          context.put("newsItems",
            Paginator.paginate(newsItemList, nbrNewsItemsPerPage, context));
          context.put("maxNewsItemsPerPage", 
	    Integer.toString(nbrNewsItemsPerPage));
       }
    }
    catch (Exception e)
    {
       log.exception(e);
       String msg = "Could not send invitation: " + e.getMessage();
       appendToMessage(context, msg);
       throw new HandlerException(msg);
    }

a91 1

d94 1
a94 1
}				/* end class ProjectNews */
@


1.6
log
@added radio buttons to default to "never" for a date to remove news items, and "immeidately" for a date to publish news items

cleanup.
@
text
@d71 1
d80 1
a80 1
    "$Id: ProjectNews.java,v 1.5 2000/11/22 02:18:34 elicia Exp $";
@


1.5
log
@modernized files--using NewsItem business object
@
text
@d79 1
a79 1
    "$Id: ProjectNews.java,v 1.4 2000/11/21 01:28:13 elicia Exp $";
d104 1
d111 2
a112 1
          context.put("maxNewsItemsPerPage", Integer.toString(nbrNewsItemsPerPage));
@


1.4
log
@added pagination for news items
@
text
@d56 1
d70 1
a70 1
import org.tigris.helm.tool.Paginator;
d79 1
a79 1
    "$Id: ProjectNews.java,v 1.3 2000/11/17 20:22:53 dlr Exp $";
a97 2

    DataSet newsItemSet = null;
d99 1
a99 6
    ArrayList newsItemList = new ArrayList();

    ProjectNewsManager newsMgr = (ProjectNewsManager)
      getDataManager (context).getManager
      ("org.tigris.helm.database.ProjectNewsManager");

d102 10
a111 10
        // Get all news items for this project
          newsItemSet = newsMgr.getNewsForProject 
                    (connection, currentProject.getID());

        for (int i = 0; i < newsItemSet.size(); i++)
        {
            Record r = newsItemSet.getRecord(i);
	    newsItemList.add(new NewsItem(connection, dMgr, r));
        }
	  
d115 4
a118 4
      log.exception (e);
      String message = "ProjectNews: " + e.getMessage ();
      if (debug) log.debug (message);
      context.put ("message", message);
d121 1
a121 1
    if (debug) log.debug ("ProjectNews:  done");
a122 10
    if (newsItemSet.size() > 0)
    {
       int nbrNewsItemsPerPage =
          Integer.parseInt(myProperties.getProperty(NEWS_ITEMS_PER_PAGE));
       context.put("newsItems",
          Paginator.paginate(newsItemList, nbrNewsItemsPerPage, context));
       context.put("maxNewsItemsPerPage", Integer.toString(nbrNewsItemsPerPage));
    }

    return templateName;
@


1.3
log
@Removed an unneeded import.
@
text
@d69 1
d78 1
a78 1
    "$Id: ProjectNews.java,v 1.2 2000/11/15 21:10:17 elicia Exp $";
d82 7
a88 3
    /**
     *  Display and process the login screen.
     */
d108 2
a109 2
      // Get all news items for this project
      newsItemSet = newsMgr.getNewsForProject 
d112 5
a116 5
      for (int i = 0; i < newsItemSet.size(); i++)
      {
          Record r = newsItemSet.getRecord(i);
	  newsItemList.add(new NewsItem(connection, dMgr, r));
      }
d130 7
a136 1
        context.put ("newsItems", newsItemList);
@


1.2
log
@using currentProject.getID() instead of getting projectID from the Form.
@
text
@a52 1
import java.text.SimpleDateFormat;
d77 1
a77 1
    "$Id: ProjectNews.java,v 1.1.1.1 2000/11/12 21:16:14 dlr Exp $";
@


1.1
log
@Initial revision
@
text
@d78 1
a78 1
    "$Id: ProjectNews.java,v 1.8 2000/11/06 21:48:26 elicia Exp $";
d95 1
a95 1
    String projectID = context.getForm ("projectID");
d105 2
a106 1
      newsItemSet = newsMgr.getNewsForProject (connection, projectID);
@


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
@@
