/*
 * $Id: NewsListForm.java,v 1.1 2004/07/26 01:34:50 marbobo Exp $
 * 
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 * 
 * $Log: NewsListForm.java,v $
 * Revision 1.1  2004/07/26 01:34:50  marbobo
 * + Initiale Version
 *
 */
package vkc.administration.form;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionMapping;

import vkc.db.serializer.VKCNewsSerializer;
import vkc.exception.DBException;
import vkc.view.form.BasicActionForm;

/**
 * Form-Bean zum Anzeigen der Systemnews
 * 
 * @author marbobo
 */
public class NewsListForm extends BasicActionForm {
	Integer[] selectedIds = new Integer[ 0 ];
	Integer   selectedId = null;

    List news = null;

    public void reset( ActionMapping mapping, HttpServletRequest request ) {
	    super.reset( mapping, request );
	    news = null;
		selectedIds = new Integer[ 0 ];
		selectedId = null;
	}

    public List getNews() throws DBException {
        if ( news == null ) {
    	    news = VKCNewsSerializer.retrieveNews();
        }
        
        return news;
    }
    
    public Integer getSelectedId() {
        return selectedId;
    }
    
    public Integer[] getSelectedIds() {
        return selectedIds;
    }
    
    public void setNews( List news1 ) {
        news = news1;
    }
    
    public void setSelectedId( Integer selectedId1 ) {
        selectedId = selectedId1;
    }
    
    public void setSelectedIds( Integer[] selectedIds1 ) {
        selectedIds = selectedIds1;
    }
}