/*
 * $Id: VKCProject.java,v 1.1 2006/10/04 03:15:08 marbobo Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 *
 * $Log: VKCProject.java,v $
 * Revision 1.1  2006/10/04 03:15:08  marbobo
 * + Vollständige Unterstützung für Templates implementiert
 * + Alles von Virtoweb auf ProCoBa umgestellt
 *
 * Revision 1.6  2004/07/20 08:59:22  jonyp
 * added copyright info + cvs log
 *
 *
 */

package vkc.procoba.project.entities;

import java.util.ArrayList;
import java.util.List;

import vkc.db.entities.VKCCategory;
import vkc.db.serializer.VKCUserSerializer;
import vkc.exception.DBException;
import vkc.util.StringUtils;

public class VKCProject extends VKCCategory {
	protected String externalContacts = "";
	protected List   leaders = new ArrayList();
	protected List   members = new ArrayList();
    protected List   projectSteps = new ArrayList();
	
	public VKCProject() {
		super();
	}

	public String getExternalContacts() {
		return externalContacts;
	}

	public void setExternalContacts(String string) {
		externalContacts = StringUtils.normalize( string );
	}

    public List getProjectSteps() {
        return projectSteps;
    }

    public void setProjectSteps(List steps) {
        projectSteps = steps == null ? new ArrayList() : steps;
    }

	public List getLeaders() throws DBException {

		if ( leaders.size()==0 ) {
			leaders = VKCUserSerializer.retrieveUserInfos( this, "c" );
		}
		return leaders;
	}

	public List getMembers() throws DBException {

		if ( members.size()==0 ) {
			members = VKCUserSerializer.retrieveUserInfos( this, "crw" );
		}
		return members;
	}
	
	public String getProjectViewLink() {
		return "/projectView.do?projectId=" + getCategoryId() + "&subfolderId=" + getCategoryId();
	}
}