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

Commit 72391e44 authored by Michael Breu's avatar Michael Breu 💬
Browse files

Some Update (including jar)

parent 9eeb9c8c
package org.codeability.sharing.plugins.api;
/**
* Represents the configuration of a plugin.
* It provides the actions a plugin supports.
* @author Michael Breu
*
*/
public class SharingPluginConfig {
/**
* the actions that a plugin supports. It contains a name,
* a command name, and
* an importService URL (not a REST URL, but a callback via Browser redirect)
*
* @author Michael Breu
*
*/
public static class Action {
private String actionName;
private String importServiceURL;
public Action(String actionName, String importServiceURL) {
super();
this.actionName = actionName;
this.importServiceURL = importServiceURL;
}
public Action() {
// JSON
}
/**
* @return the actionName
* the id of this action.
* An arbitrary String, unique for this plugin.
*/
public String getActionName() {
return actionName;
}
public String actionId;
/**
* @param actionName the actionName to set
* the call back for this action (in order to be called back).
* When the action is invoked the call back URL is extended by
* <ol>
* <li>the shoppingBasketToken</li>
* <li>the apiBaseURL for a REST based callback as query parameter</li>
* <li>the returnURL a URL that should be redirected to, to get back to the original application, as query parameter</li>
* </ol>
* e.g. http://localhost:8081/sharingImport/<b>10e1a1b5-74da-43a9-80eb-67a2b9cd0f93</b>?<b>returnURL=http://localhost:8080</b>&<b>apiBaseURL=http://localhost:8080/api</b>
*/
public void setActionName(String actionName) {
public String actionTransferURL;
/**
* a descriptive name of the action.
* For presentation to the end user.
* E.g. "Export to Artemis"
*/
public String actionName;
/**
* a boolean expression on the exercise meta data to filter the relevant exercises for this action.
* The expression is defined in java expression language (see https://docs.oracle.com/javaee/6/tutorial/doc/gjddd.html).
*
* e.g. "metadata.type.externalName=='programming exercise"
*/
public String filterELExpression;
/**
*
* @param actionName
* @param actionTransferURL
* @param actionId
* @param filterELExpression
*/
public Action(String actionId, String actionTransferURL, String actionName, String filterELExpression) {
super();
this.actionId = actionId;
this.actionName = actionName;
this.actionTransferURL = actionTransferURL;
this.filterELExpression = filterELExpression;
}
public String getImportServiceURL() {
return importServiceURL;
public Action() {
// JSON
}
public void setImportServiceURL(String importServiceURL) {
this.importServiceURL = importServiceURL;
}
}
private String pluginName;
/**
* the version of this plugin config.
*/
public String version = "0.1";
/**
* the name of this plugin.
*/
public String pluginName;
/**
* the list of actions supported by this plugin.
*/
public Action[] actions;
public SharingPluginConfig(String pluginName, Action[] actions) {
super();
this.pluginName = pluginName;
this.actions = actions;
}
private Action[] actions;
public SharingPluginConfig() {
// JSON
}
public String getPluginName() {
return pluginName;
}
public void setPluginName(String pluginName) {
this.pluginName = pluginName;
}
/**
* @return the actions
*/
public Action[] getActions() {
return actions;
}
/**
* @param actions the actions to set
*/
public void setActions(Action[] actions) {
this.actions = actions;
}
}
package org.codeability.sharing.plugins.api;
import java.util.List;
/**
* represents a collection of exercise items.
* It is combined with some basic user information, to identify the user by its email.
* @author Michael Breu
*
*/
public class ShoppingBasket {
private UserInfo userInfo;
private ExerciseInfo[] exerciseInfo;
/**
* the user information
*/
public UserInfo userInfo;
/**
* the list of selected exercises in the basket.
*/
public ExerciseInfo[] exerciseInfo;
public ShoppingBasket(UserInfo userInfo, ExerciseInfo[] exerciseInfo) {
super();
......@@ -13,36 +28,13 @@ public class ShoppingBasket {
public ShoppingBasket() {
// JSON
}
/**
* @return the userInfo
*/
public UserInfo getUserInfo() {
return userInfo;
}
/**
* @param userInfo the userInfo to set
*/
public void setUserInfo(UserInfo userInfo) {
this.userInfo = userInfo;
}
/**
* @return the exerciseInfo
*/
public ExerciseInfo[] getExerciseInfo() {
return exerciseInfo;
}
/**
* @param exerciseInfo the exerciseInfo to set
*/
public void setExerciseInfo(ExerciseInfo[] exerciseInfo) {
this.exerciseInfo = exerciseInfo;
}
public static class UserInfo {
String email;
/**
* the email of the user that checked out this shopping basket.
*/
public String email;
public UserInfo(String email) {
super();
......@@ -52,71 +44,38 @@ public class ShoppingBasket {
public UserInfo() {
// JSON
}
/**
* @return the email
*/
public String getEmail() {
return email;
}
/**
* @param email the email to set
*/
public void setEmail(String email) {
this.email = email;
}
}
public static class ExerciseInfo {
private String gitLabURI;
private int gitLabProjectId;
private String title;
public ExerciseInfo(String title, int gitLabProjectId, String gitLabURI) {
super();
this.title = title;
this.setGitLabProjectId(gitLabProjectId);
this.gitLabURI = gitLabURI;
}
public ExerciseInfo() {
// JSON
}
/**
* @return the title
* the title of the exercise.
*/
public String getTitle() {
return title;
}
public String title;
/**
* @param title the title to set
* the keywords of the exercise.
*/
public void setTitle(String title) {
this.title = title;
}
public List<String> keywords;
/**
* @return the gitLabURI
* the URI of the gitlab repository (not necessary the clone URI).
*/
public String getGitLabURI() {
return gitLabURI;
}
public String gitLabURI;
/**
* @param gitLabURI the gitLabURI to set
* the project id in gitlab.
*/
public void setGitLabURI(String gitLabURI) {
public int gitLabProjectId;
public ExerciseInfo(String title, int gitLabProjectId, String gitLabURI, List<String> keywords) {
super();
this.title = title;
this.gitLabProjectId = gitLabProjectId;
this.gitLabURI = gitLabURI;
this.keywords = keywords;
}
public int getGitLabProjectId() {
return gitLabProjectId;
public ExerciseInfo() {
// JSON
}
public void setGitLabProjectId(int gitLabProjectId) {
this.gitLabProjectId = gitLabProjectId;
}
}
}
/generated-sources/
/maven-archiver/
/maven-status/
/test-classes/
/classes/
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