Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
removed files
Browse files Browse the repository at this point in the history
  • Loading branch information
wegrata committed Jun 30, 2014
1 parent 7a39d2b commit b1e6be0
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 77 deletions.
14 changes: 0 additions & 14 deletions .classpath

This file was deleted.

17 changes: 0 additions & 17 deletions .gitignore.orig

This file was deleted.

14 changes: 0 additions & 14 deletions .project

This file was deleted.

93 changes: 79 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,89 @@

<groupId>gov.adlnet.xapi</groupId>
<artifactId>xapi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>0.1.0</version>
<packaging>jar</packaging>
<name>xapi</name>
<url>http://maven.apache.org</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/adlnet/jxapi</url>
</scm>
<name>xAPI</name>
<description>
Java xAPI client
</description>
<url>https://github.com/adlnet/jxapi</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/adlnet/jxapi.git</connection>
<developerConnection>scm:git:[email protected]:adlnet/jxapi.git</developerConnection>
<url>https://github.com/adlnet/jxapi</url>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/adlnet/jxapi/issues</url>
</issueManagement>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
Expand Down
17 changes: 7 additions & 10 deletions src/main/java/gov/adlnet/xapi/model/Definition.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
package gov.adlnet.xapi.model;

import java.util.HashMap;
import java.util.Map.Entry;
import com.google.gson.*;
public class Definition {
private HashMap<String, String> extensions;
private JsonObject extensions;
public JsonElement serialize(){
JsonObject extensionsObj = new JsonObject();
for (Entry<String, String> item : extensions.entrySet()){
extensionsObj.addProperty(item.getKey(), item.getValue());
}
return extensionsObj;

JsonObject self = new JsonObject();
self.add("extensions", extensions);
return self;
}
public HashMap<String, String> getExtensions() {
public JsonObject getExtensions() {
return extensions;
}

public void setExtensions(HashMap<String, String> extensions) {
public void setExtensions(JsonObject extensions) {
this.extensions = extensions;
}
}
12 changes: 4 additions & 8 deletions src/main/java/gov/adlnet/xapi/model/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public void setDuration(String duration) {
this.duration = duration;
}

public HashMap<String, String> getExtensions() {
public JsonObject getExtensions() {
return extensions;
}

public void setExtensions(HashMap<String, String> extensions) {
public void setExtensions(JsonObject extensions) {
this.extensions = extensions;
}

Expand All @@ -70,11 +70,7 @@ public JsonElement serialize() {
obj.addProperty("duration", this.duration);
}
if (this.extensions != null) {
JsonObject extensionsObj = new JsonObject();
obj.add("extensions", extensionsObj);
for (Entry<String, String> item : extensions.entrySet()) {
extensionsObj.addProperty(item.getKey(), item.getValue());
}
obj.add("extensions", extensions);
}
if (this.score != null) {
obj.add("score", this.score.serialize());
Expand All @@ -87,5 +83,5 @@ public JsonElement serialize() {
private Boolean completion;
private String response;
private String duration;
private HashMap<String, String> extensions;
private JsonObject extensions;
}

0 comments on commit b1e6be0

Please sign in to comment.