Developed a "mixin"-based approach to the presentation of project information.

git-svn-id: https://svn.cs.york.ac.uk/svn/ossmeter/Software/source@492 1b171192-1bc4-4300-84b6-1b6fde2e8ce3

jw@CS.YORK.AC.UK jw@CS.YORK.AC.UK 2013-09-09

added web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/eclass2mixinclass.egl
added web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/OssmeterMixins.java
added web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/ProjectOverviewMixin.java
added web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/package2configurationClass.egl
added web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/mixinUtil.eol
added web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/generateMixins.egx
added web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/PongoMixin.java
added web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/Util.java
changed web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/ProjectMixin.java
changed web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/ApiApplication.java
changed web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/MetricsResource.java
changed web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/ProjectResource.java
copied web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/ProjectsResource.java -> web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/ProjectListResource.java
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/eclass2mixinclass.egl Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/OssmeterMixins.java Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/ProjectOverviewMixin.java Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/package2configurationClass.egl Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/mixinUtil.eol Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/generateMixins.egx Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/PongoMixin.java Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/Util.java Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/mixins/ProjectMixin.java Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/ApiApplication.java Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/MetricsResource.java Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/ProjectResource.java Diff Switch to side-by-side view
Loading...
web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/ProjectsResource.java to web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/ProjectListResource.java
--- a/web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/ProjectsResource.java
+++ b/web/org.ossmeter.platform.client.api/src/org/ossmeter/platform/client/api/ProjectListResource.java
@@ -1,19 +1,19 @@
 package org.ossmeter.platform.client.api;
 
-import java.io.StringWriter;
 import java.util.Iterator;
 
 import org.ossmeter.platform.Platform;
-import org.ossmeter.platform.client.api.mixins.ProjectMixin;
+import org.ossmeter.platform.client.api.mixins.PongoMixin;
+import org.ossmeter.platform.client.api.mixins.ProjectOverviewMixin;
 import org.ossmeter.repository.model.Project;
 import org.ossmeter.repository.model.ProjectRepository;
 import org.restlet.resource.Get;
 import org.restlet.resource.ServerResource;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.googlecode.pongo.runtime.Pongo;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class ProjectsResource extends ServerResource {
+public class ProjectListResource extends ServerResource {
 
 	@Get("json")
     public String represent() {
@@ -23,7 +23,10 @@
 		ProjectRepository projectRepo = platform.getProjectRepositoryManager().getProjectRepository();
 		
 		ObjectMapper mapper = new ObjectMapper();
-		mapper.addMixInAnnotations(Project.class, ProjectMixin.class);
+		//FIXME: this mixin isn't auto-generated. What shall we do about that?
+		// (It's not necessarily a bad thing)
+		mapper.addMixInAnnotations(Pongo.class, PongoMixin.class);
+		mapper.addMixInAnnotations(Project.class, ProjectOverviewMixin.class);
 		
 		Iterator<Project> it = projectRepo.getProjects().iterator();