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

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

Update to Version 0.1.2

parent 6259a606
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.codeability.sharing</groupId>
<artifactId>SharingPluginPlatformAPI</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
<name>SharingPluginPlatformAPI</name>
<description>CodeAbility Sharing Plugin Platform API</description>
<packaging>jar</packaging>
......
......@@ -5,5 +5,6 @@
*/
module sharingPluginPlatform {
exports org.codeability.sharing.plugins.api;
exports org.codeability.sharing.plugins.api.search;
requires com.fasterxml.jackson.annotation;
}
\ No newline at end of file
......@@ -65,6 +65,9 @@ public class SharingPluginConfig {
this.filterELExpression = filterELExpression;
}
/**
* empty constructor for JSON.
*/
public Action() {
// JSON
}
......
package org.codeability.sharing.plugins.api;
import java.util.List;
import org.codeability.sharing.plugins.api.search.SearchResultDTO;
/**
* represents a collection of exercise items.
......@@ -17,7 +17,7 @@ public class ShoppingBasket {
/**
* the list of selected exercises in the basket.
*/
public ExerciseInfo[] exerciseInfo;
public SearchResultDTO[] exerciseInfo;
/**
* token valid until (msecs since 1.1.1970)
......@@ -32,7 +32,7 @@ public class ShoppingBasket {
* @param exerciseInfo the exercise infos
*/
@Deprecated
public ShoppingBasket(UserInfo userInfo, ExerciseInfo[] exerciseInfo) {
public ShoppingBasket(UserInfo userInfo, SearchResultDTO[] exerciseInfo) {
super();
this.userInfo = userInfo;
this.exerciseInfo = exerciseInfo;
......@@ -45,13 +45,16 @@ public class ShoppingBasket {
* @param exerciseInfo the list of exercises
* @param tokenValidUntil the validity of the basket
*/
public ShoppingBasket(UserInfo userInfo, ExerciseInfo[] exerciseInfo, long tokenValidUntil) {
public ShoppingBasket(UserInfo userInfo, SearchResultDTO[] exerciseInfo, long tokenValidUntil) {
super();
this.userInfo = userInfo;
this.exerciseInfo = exerciseInfo;
this.tokenValidUntil = tokenValidUntil;
}
/**
* empty constructor for JSON.
*/
public ShoppingBasket() {
// JSON
}
......@@ -85,50 +88,4 @@ public class ShoppingBasket {
}
}
/**
* info about exercise in shopping basket.
* @author Michael Breu
*
*/
public static class ExerciseInfo {
/**
* the title of the exercise.
*/
public String title;
/**
* the keywords of the exercise.
*/
public List<String> keywords;
/**
* the URI of the gitlab repository (not necessary the clone URI).
*/
public String gitLabURI;
/**
* the project id in gitlab.
*/
public int gitLabProjectId;
/**
* convenience constructor.
* @param title the title
* @param gitLabProjectId the gitlab project id
* @param gitLabURI the gitlab URI of the project
* @param keywords the keywords
*/
public ExerciseInfo(String title, int gitLabProjectId, String gitLabURI, List<String> keywords) {
super();
this.title = title;
this.gitLabProjectId = gitLabProjectId;
this.gitLabURI = gitLabURI;
this.keywords = keywords;
}
/**
* JSON constructor
*/
public ExerciseInfo() {
// JSON
}
}
}
......@@ -21,6 +21,9 @@ public class UserPrincipal {
this.gitLabAccessToken = gitLabAccessToken;
}
/**
* empty constructor for JSON.
*/
public UserPrincipal() {
// JSON
}
......
......@@ -2,6 +2,10 @@ package org.codeability.sharing.plugins.api.search;
import java.util.List;
/**
* DTO for search queries
*/
public class SearchInputDTO {
private String fulltextQuery;
private SearchInputMetadataDTO metadata;
......@@ -10,11 +14,27 @@ public class SearchInputDTO {
private List<String> selectedFileFormat;
private int page;
/**
* the default page size
*/
public static final int PAGE_SIZE = 10;
/**
* empty constructor for JSON.
*/
public SearchInputDTO() {
// empty for jackson
// empty for JSON
}
/**
* convenience constructor for search input
* @param fulltextQuery the full text query
* @param metadata the meta data
* @param selectedRepository the selected repository
* @param selectedUniversity the selected university
* @param selectedFileFormat the selected file format
* @param page the page
*/
public SearchInputDTO(String fulltextQuery, SearchInputMetadataDTO metadata,
List<String> selectedRepository, List<String> selectedUniversity,
List<String> selectedFileFormat, int page) {
......@@ -26,14 +46,26 @@ public class SearchInputDTO {
this.page = page;
}
/**
* returns the full text query
* @return
*/
public String getFulltextQuery() {
return fulltextQuery;
}
/**
* sets the full text query
* @param fulltextQuery
*/
public void setFulltextQuery(String fulltextQuery) {
this.fulltextQuery = fulltextQuery;
}
/**
* returns the meta data
* @return
*/
public SearchInputMetadataDTO getMetadata() {
return metadata;
}
......@@ -44,6 +76,11 @@ public class SearchInputDTO {
public void setMetadata(SearchInputMetadataDTO metadata) {
this.metadata = metadata;
}
/**
* returns the selected repository.
* @return
*/
public List<String> getSelectedRepository() {
return selectedRepository;
}
......
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