package org.opentdc.wtt.file;
import java.util.ArrayList;
import java.util.List;

import org.opentdc.wtt.ProjectModel;
import org.opentdc.wtt.ResourceRefModel;

public class WttProject {
	ProjectModel projectModel;
	ArrayList<WttProject> projects;
	ArrayList<ResourceRefModel> resources;

	public WttProject() {
	}

	public ProjectModel getProjectModel() {
		return projectModel;
	}

	public void setProjectModel(ProjectModel projectModel) {
		this.projectModel = projectModel;
	}

	public List<WttProject> getProjects() {
		return projects;
	}

	public void setProjects(ArrayList<WttProject> projects) {
		this.projects = projects;
	}
	
	public void addProject(WttProject p) {
		this.projects.add(p);
	}
	
	public boolean removeProject(WttProject p) {
		return this.projects.remove(p);
	}

	public List<ResourceRefModel> getResources() {
		return resources;
	}

	public void setResources(ArrayList<ResourceRefModel> resources) {
		this.resources = resources;
	}
	
	public void addResource(ResourceRefModel r) {
		this.resources.add(r);
	}
	
	public boolean removeResource(ResourceRefModel r) {
		return this.resources.remove(r);
	}
}

@@ -305,16 +305,107 @@
 ect() %7B%0A
+%09%09projects = new ArrayList%3CWttProject%3E();%0A%09%09resources = new ArrayList%3CResourceRefModel%3E();%0A
 %09%7D%0A%0A%09pub
@@ -1217,10 +1217,366 @@
 (r);%0A%09%7D%0A
+%09%0A%09public boolean removeResource(String rid) %7B%0A%09%09for (ResourceRefModel _r : resources) %7B%0A%09%09%09if (_r.getId().equalsIgnoreCase(rid))%7B%0A%09%09%09%09return this.resources.remove(_r);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return false;%0A%09%7D%0A%09%0A%09public void setTitle(String title) %7B%0A%09%09projectModel.setTitle(title);%0A%09%7D%0A%09public void setDescription(String desc) %7B%0A%09%09projectModel.setDescription(desc);%0A%09%7D%0A%0A
 %7D%0A

initialize projects and resources, add setters for title and description, add removeResource-method