Included per-user-per-project logging. Bug in ProjectMembership.commits though.

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

jw@CS.YORK.AC.UK jw@CS.YORK.AC.UK 2014-02-16

added temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/ProjectMembership.java
changed temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Artefact.java
changed temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Biodiversity.java
changed temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Project.java
changed temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/User.java
changed temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/biodiversity.ecore
changed temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/biodiversity.emf
changed temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/Extractor.java
copied temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Commit.java -> temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Commits.java
copied temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Countable.java -> temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/ProjectMembershipCollection.java
temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/ProjectMembership.java Diff Switch to side-by-side view
Loading...
temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Artefact.java Diff Switch to side-by-side view
Loading...
temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Biodiversity.java Diff Switch to side-by-side view
Loading...
temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Project.java Diff Switch to side-by-side view
Loading...
temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/User.java Diff Switch to side-by-side view
Loading...
temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/biodiversity.ecore Diff Switch to side-by-side view
Loading...
temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/biodiversity.emf Diff Switch to side-by-side view
Loading...
temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/Extractor.java Diff Switch to side-by-side view
Loading...
temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Commit.java to temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Commits.java
--- a/temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Commit.java
+++ b/temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Commits.java
@@ -6,37 +6,51 @@
 import com.googlecode.pongo.runtime.querying.*;
 
 
-public class Commit extends Countable {
+public class Commits extends Pongo {
+	
+	protected List<String> commitTimes = null;
 	
 	
-	
-	public Commit() { 
+	public Commits() { 
 		super();
-		super.setSuperTypes("org.ossmeter.platform.mining.msr14.model.Countable");
-		NUMBER.setOwningType("org.ossmeter.platform.mining.msr14.model.Commit");
-		FREQUENCY.setOwningType("org.ossmeter.platform.mining.msr14.model.Commit");
-		TOTAL.setOwningType("org.ossmeter.platform.mining.msr14.model.Commit");
-		ADDITIONS.setOwningType("org.ossmeter.platform.mining.msr14.model.Commit");
-		DELETIONS.setOwningType("org.ossmeter.platform.mining.msr14.model.Commit");
-		TOTALFILES.setOwningType("org.ossmeter.platform.mining.msr14.model.Commit");
-		AVERAGEFILESPERCOMMIT.setOwningType("org.ossmeter.platform.mining.msr14.model.Commit");
+		dbObject.put("commitTimes", new BasicDBList());
+		COUNT.setOwningType("org.ossmeter.platform.mining.msr14.model.Commits");
+		TOTALCHANGES.setOwningType("org.ossmeter.platform.mining.msr14.model.Commits");
+		ADDITIONS.setOwningType("org.ossmeter.platform.mining.msr14.model.Commits");
+		DELETIONS.setOwningType("org.ossmeter.platform.mining.msr14.model.Commits");
+		ASAUTHOR.setOwningType("org.ossmeter.platform.mining.msr14.model.Commits");
+		ASCOMMITTER.setOwningType("org.ossmeter.platform.mining.msr14.model.Commits");
+		TOTALFILES.setOwningType("org.ossmeter.platform.mining.msr14.model.Commits");
+		AVERAGEFILESPERCOMMIT.setOwningType("org.ossmeter.platform.mining.msr14.model.Commits");
+		COMMITTIMES.setOwningType("org.ossmeter.platform.mining.msr14.model.Commits");
 	}
 	
-	public static NumericalQueryProducer NUMBER = new NumericalQueryProducer("number");
-	public static NumericalQueryProducer FREQUENCY = new NumericalQueryProducer("frequency");
-	public static NumericalQueryProducer TOTAL = new NumericalQueryProducer("total");
+	public static NumericalQueryProducer COUNT = new NumericalQueryProducer("count");
+	public static NumericalQueryProducer TOTALCHANGES = new NumericalQueryProducer("totalChanges");
 	public static NumericalQueryProducer ADDITIONS = new NumericalQueryProducer("additions");
 	public static NumericalQueryProducer DELETIONS = new NumericalQueryProducer("deletions");
+	public static NumericalQueryProducer ASAUTHOR = new NumericalQueryProducer("asAuthor");
+	public static NumericalQueryProducer ASCOMMITTER = new NumericalQueryProducer("asCommitter");
 	public static NumericalQueryProducer TOTALFILES = new NumericalQueryProducer("totalFiles");
 	public static NumericalQueryProducer AVERAGEFILESPERCOMMIT = new NumericalQueryProducer("averageFilesPerCommit");
+	public static ArrayQueryProducer COMMITTIMES = new ArrayQueryProducer("commitTimes");
 	
 	
-	public int getTotal() {
-		return parseInteger(dbObject.get("total")+"", 0);
+	public int getCount() {
+		return parseInteger(dbObject.get("count")+"", 0);
 	}
 	
-	public Commit setTotal(int total) {
-		dbObject.put("total", total);
+	public Commits setCount(int count) {
+		dbObject.put("count", count);
+		notifyChanged();
+		return this;
+	}
+	public int getTotalChanges() {
+		return parseInteger(dbObject.get("totalChanges")+"", 0);
+	}
+	
+	public Commits setTotalChanges(int totalChanges) {
+		dbObject.put("totalChanges", totalChanges);
 		notifyChanged();
 		return this;
 	}
@@ -44,7 +58,7 @@
 		return parseInteger(dbObject.get("additions")+"", 0);
 	}
 	
-	public Commit setAdditions(int additions) {
+	public Commits setAdditions(int additions) {
 		dbObject.put("additions", additions);
 		notifyChanged();
 		return this;
@@ -53,8 +67,26 @@
 		return parseInteger(dbObject.get("deletions")+"", 0);
 	}
 	
-	public Commit setDeletions(int deletions) {
+	public Commits setDeletions(int deletions) {
 		dbObject.put("deletions", deletions);
+		notifyChanged();
+		return this;
+	}
+	public int getAsAuthor() {
+		return parseInteger(dbObject.get("asAuthor")+"", 0);
+	}
+	
+	public Commits setAsAuthor(int asAuthor) {
+		dbObject.put("asAuthor", asAuthor);
+		notifyChanged();
+		return this;
+	}
+	public int getAsCommitter() {
+		return parseInteger(dbObject.get("asCommitter")+"", 0);
+	}
+	
+	public Commits setAsCommitter(int asCommitter) {
+		dbObject.put("asCommitter", asCommitter);
 		notifyChanged();
 		return this;
 	}
@@ -62,7 +94,7 @@
 		return parseInteger(dbObject.get("totalFiles")+"", 0);
 	}
 	
-	public Commit setTotalFiles(int totalFiles) {
+	public Commits setTotalFiles(int totalFiles) {
 		dbObject.put("totalFiles", totalFiles);
 		notifyChanged();
 		return this;
@@ -71,12 +103,18 @@
 		return parseDouble(dbObject.get("averageFilesPerCommit")+"", 0.0d);
 	}
 	
-	public Commit setAverageFilesPerCommit(double averageFilesPerCommit) {
+	public Commits setAverageFilesPerCommit(double averageFilesPerCommit) {
 		dbObject.put("averageFilesPerCommit", averageFilesPerCommit);
 		notifyChanged();
 		return this;
 	}
 	
+	public List<String> getCommitTimes() {
+		if (commitTimes == null) {
+			commitTimes = new PrimitiveList<String>(this, (BasicDBList) dbObject.get("commitTimes"));
+		}
+		return commitTimes;
+	}
 	
 	
 	
temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Countable.java to temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/ProjectMembershipCollection.java
--- a/temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/Countable.java
+++ b/temp/org.ossmeter.platform.mining.msr14/src/org/ossmeter/platform/mining/msr14/model/ProjectMembershipCollection.java
@@ -1,45 +1,31 @@
 package org.ossmeter.platform.mining.msr14.model;
 
+import com.googlecode.pongo.runtime.*;
+import java.util.*;
 import com.mongodb.*;
-import java.util.*;
-import com.googlecode.pongo.runtime.*;
-import com.googlecode.pongo.runtime.querying.*;
 
-
-public class Countable extends Pongo {
+public class ProjectMembershipCollection extends PongoCollection<ProjectMembership> {
+	
+	public ProjectMembershipCollection(DBCollection dbCollection) {
+		super(dbCollection);
+	}
+	
+	public Iterable<ProjectMembership> findById(String id) {
+		return new IteratorIterable<ProjectMembership>(new PongoCursorIterator<ProjectMembership>(this, dbCollection.find(new BasicDBObject("_id", id))));
+	}
 	
 	
-	
-	public Countable() { 
-		super();
-		NUMBER.setOwningType("org.ossmeter.platform.mining.msr14.model.Countable");
-		FREQUENCY.setOwningType("org.ossmeter.platform.mining.msr14.model.Countable");
+	@Override
+	public Iterator<ProjectMembership> iterator() {
+		return new PongoCursorIterator<ProjectMembership>(this, dbCollection.find());
 	}
 	
-	public static NumericalQueryProducer NUMBER = new NumericalQueryProducer("number");
-	public static NumericalQueryProducer FREQUENCY = new NumericalQueryProducer("frequency");
-	
-	
-	public int getNumber() {
-		return parseInteger(dbObject.get("number")+"", 0);
+	public void add(ProjectMembership projectMembership) {
+		super.add(projectMembership);
 	}
 	
-	public Countable setNumber(int number) {
-		dbObject.put("number", number);
-		notifyChanged();
-		return this;
-	}
-	public int getFrequency() {
-		return parseInteger(dbObject.get("frequency")+"", 0);
+	public void remove(ProjectMembership projectMembership) {
+		super.remove(projectMembership);
 	}
 	
-	public Countable setFrequency(int frequency) {
-		dbObject.put("frequency", frequency);
-		notifyChanged();
-		return this;
-	}
-	
-	
-	
-	
 }