This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Commit a503da4b authored by Michael Breu's avatar Michael Breu 💬
Browse files

Updateing to V0.1.7: Various improvements

parent 199df83f
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.codeability.sharing</groupId>
<artifactId>SharingPluginPlatformAPI</artifactId>
<version>0.1.6</version>
<version>0.1.7</version>
<name>SharingPluginPlatformAPI</name>
<description>CodeAbility Sharing Plugin Platform API</description>
<packaging>jar</packaging>
......
......@@ -327,6 +327,8 @@ public class SearchResultDTO {
private String filename;
private String path;
private String commit_id;
private String parentId;
private String[] children;
@JsonDeserialize(converter = NoUTCInstantDeserializer.class)
@JsonSerialize(converter = UTCInstantSerializer.class)
private Instant indexing_date;
......@@ -363,7 +365,35 @@ public class SearchResultDTO {
this.indexing_date = indexing_date;
}
@Override
/**
* @return the parentId
*/
public String getParentId() {
return parentId;
}
/**
* @param parentId the parentId to set
*/
public void setParentId(String parentId) {
this.parentId = parentId;
}
/**
* @return the children
*/
public String[] getChildren() {
return children;
}
/**
* @param children the children to set
*/
public void setChildren(String[] children) {
this.children = children;
}
@Override
public final int hashCode() {
final int prime = 31;
int result = this.path.hashCode();
......
......@@ -51,82 +51,144 @@ public class UserProvidedMetadataDTO {
private String[] requires;
private String image;
/**
* returns the identifier
* @return
*/
public String getIdentifier() {
return identifier;
}
/**
* @param identifier identifier
*/
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
/**
* @return version
*/
public String getVersion() {
return version;
}
/**
* @param version version
*/
public void setVersion(String version) {
this.version = version;
}
/**
* @return type
*/
public ExerciseType getType() {
return type;
}
/**
* @param type type
*/
public void setType(ExerciseType type) {
this.type = type;
}
/**
* @return natural languages
*/
public String[] getLanguage() {
return language;
}
/**
* @param language natural languages
*/
public void setLanguage(String[] language) {
this.language = language;
}
/**
* @return status
*/
public String getStatus() {
return status;
}
/**
* @param status status
*/
public void setStatus(String status) {
this.status = status;
}
/**
* @return education level
*/
public String getEducationLevel() {
return educationLevel;
}
/**
* @param educationLevel educational level
*/
public void setEducationLevel(String educationLevel) {
this.educationLevel = educationLevel;
}
/**
* @return audience
*/
public String getAudience() {
return audience;
}
/**
* @param audience audience
*/
public void setAudience(String audience) {
this.audience = audience;
}
/**
* @return time required
*/
public String getTimeRequired() {
return timeRequired;
}
/**
* @param timeRequired time required
*/
public void setTimeRequired(String timeRequired) {
this.timeRequired = timeRequired;
}
/**
* @return creators
*/
public Person[] getCreator() {
return creator;
}
/**
* @param creator creators
*/
public void setCreator(Person[] creator) {
this.creator = creator;
}
/**
* @return publishers
*/
public Person[] getPublisher() {
return publisher;
}
/**
* @param publisher publishers
*/
public void setPublisher(Person[] publisher) {
this.publisher = publisher;
}
......@@ -390,9 +452,29 @@ public class UserProvidedMetadataDTO {
}
/**
* supported exercise tpyes
* @author Michael Breu
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ExerciseType {
PROGRAMMING_EXERCISE("programming exercise"), EXERCISE("exercise"), COLLECTION("collection"), OTHER("other");
/**
* programming exercises
*/
PROGRAMMING_EXERCISE("programming exercise"),
/**
* (non programming) exercises
*/
EXERCISE("exercise"),
/**
* collections of exercises
*/
COLLECTION("collection"),
/**
* other stuff
*/
OTHER("other");
ExerciseType(String externalName) {
this.externalName = externalName;
......
package org.codeability.sharing.plugins.api.search.util;
import java.text.ParseException;
import java.util.regex.MatchResult;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* represents an exercise id.
* Also provides some utility methods to parse and unparse exercise Ids
* @author Michael Breu
*
*/
public class ExerciseId {
private String projectId; // should be numeric
private String path; // a path with slashes (root slash omitted)
public ExerciseId() {
}
public ExerciseId(String projectId, String path) {
super();
this.projectId = projectId;
this.path = path;
}
/**
* @return the projectId
*/
public String getProjectId() {
return projectId;
}
/**
* @return the path
*/
public String getPath() {
return path;
}
protected final static Pattern ExerciseIdPattern = Pattern.compile("(\\d+)(:(.*))?");
public String toString() {
if(path==null)
return projectId;
if (path.equals(""))
return projectId;
return projectId + ":" + path;
}
/**
* parses the external representation of an ExerciseId.
* @param externalRepresentation
* @return
* @throws ParseException
*/
public static ExerciseId fromString(String externalRepresentation) throws ParseException {
final Matcher ma = ExerciseIdPattern.matcher(externalRepresentation);
if(!ma.matches()) throw new ParseException("Cannot parse " + externalRepresentation, 0);
final MatchResult matchResult = ma.toMatchResult();
String projectId = matchResult.group(1);
String path = matchResult.group(3);
while (path!=null && path.startsWith("/")) {
path = path.substring(1);
}
return new ExerciseId(projectId, path);
}
}
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codeability.sharing</groupId>
<artifactId>SharingPluginPlatformAPI</artifactId>
<version>0.1.7</version>
<name>SharingPluginPlatformAPI</name>
<description>CodeAbility Sharing Plugin Platform API</description>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Plugin versions -->
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
<maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
<maven-failsafe-plugin.version>3.0.0-M4</maven-failsafe-plugin.version>
<maven-idea-plugin.version>2.2.1</maven-idea-plugin.version>
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
<maven-war-plugin.version>3.2.3</maven-war-plugin.version>
<maven-checkstyle.version>3.1.1</maven-checkstyle.version>
<checkstyle.version>8.32</checkstyle.version>
<spring-nohttp-checkstyle.version>0.0.4.RELEASE</spring-nohttp-checkstyle.version>
<frontend-maven-plugin.version>1.10.0</frontend-maven-plugin.version>
<git-commit-id-plugin.version>4.0.0</git-commit-id-plugin.version>
<jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.module/jackson-module-jaxb-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>2.10.4</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>target</id>
<name>Local target repository, to be promoted to git</name>
<url>file://${project.basedir}/target</url>
<layout>default</layout>
</repository>
</distributionManagement>
<build>
<defaultGoal>package</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>deploy</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>${maven-eclipse-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-idea-plugin</artifactId>
<version>${maven-idea-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<!-- unused <executions> <execution> <id>deploy-to-local-directory</id>
<phase>install</phase> <goals> <goal>copy-resources</goal> </goals> <configuration>
<outputDirectory>./target</outputDirectory> <resources> <resource> <directory>${project.build.directory}</directory>
<includes> <include>${project.build.finalName}.jar</include> </includes>
<filtering>false</filtering> </resource> </resources> </configuration> </execution>
</executions> -->
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>deploy</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<groupId>org.codeability.sharing</groupId>
<artifactId>SharingPluginPlatformAPI</artifactId>
<versioning>
<release>0.1.6</release>
<release>0.1.7</release>
<versions>
<version>0.0.1</version>
<version>0.0.2</version>
......@@ -16,7 +16,8 @@
<version>0.1.4</version>
<version>0.1.5</version>
<version>0.1.6</version>
<version>0.1.7</version>
</versions>
<lastUpdated>20210623162553</lastUpdated>
<lastUpdated>20210624102431</lastUpdated>
</versioning>
</metadata>
5aa295b857b96a62961d51b263225e8d
\ No newline at end of file
957fb7b80d87d172c8d824095fb73530
\ No newline at end of file
79415ff21ba4db6f6ab60af99fe950449b9e4616
\ No newline at end of file
1a9cbb6e83ff789825116aed0e339fd10f2d0c3d
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment