This commit is contained in:
Paolo Fabriani 2016-11-25 10:52:54 +00:00
parent 22c42fd6f3
commit 8122447dd7
4 changed files with 61 additions and 24 deletions

View File

@ -24,8 +24,8 @@ public class AlgorithmPackage {
out.put("name", a.getName());
out.put("category", a.getCategory());
out.put("class", a.getClazz());
out.put("p5", "TEMP_TRANSDUCERS");
out.put("p6", "TEMP_??");
out.put("atype", a.getAlgorithmType());
out.put("skipjava", a.getSkipJava());
out.put("vre", "FAKE_VRE");
out.put("packageurl", a.getPackageURL());
out.put("description", a.getDescription());

View File

@ -13,6 +13,10 @@ public class Algorithm {
private String clazz;
private String algorithmType;
private String skipJava;
private String packageURL;
private Collection<Action> actions;
@ -65,6 +69,10 @@ public class Algorithm {
return dependencies;
***REMOVED***
public void setDependencies(Collection<Dependency> deps) {
this.dependencies = deps;
***REMOVED***
public String toString() {
String out = "Algorithm: " + this.getName()+"\n";
out+=" Class Name: " + this.getClazz()+"\n";
@ -89,4 +97,20 @@ public class Algorithm {
this.packageURL = packageURL;
***REMOVED***
public String getAlgorithmType() {
return algorithmType;
***REMOVED***
public void setAlgorithmType(String algorithmType) {
this.algorithmType = algorithmType;
***REMOVED***
public String getSkipJava() {
return skipJava;
***REMOVED***
public void setSkipJava(String skipJava) {
this.skipJava = skipJava;
***REMOVED***
***REMOVED***

View File

@ -8,9 +8,9 @@ public class AddAlgorithmCommand {
private String name;
private String category;
private String clazz;
private String vre;
private String p6;
private String p7;
private String scope;
private String algorithmType;
private String skipJava;
private String url;
private String description;
@ -25,18 +25,31 @@ public class AddAlgorithmCommand {
if (st.hasMoreElements())
clazz = st.nextToken();
if (st.hasMoreElements())
vre = st.nextToken();
scope = st.nextToken();
if (st.hasMoreElements())
p6 = st.nextToken();
algorithmType = st.nextToken();
if (st.hasMoreElements())
p7 = st.nextToken();
skipJava = st.nextToken();
if (st.hasMoreElements())
url = st.nextToken();
description = "";
String d = "";
while (st.hasMoreElements())
description = description + st.nextToken() + " ";
d = d + st.nextToken() + " ";
this.setDescription(d);
***REMOVED***
public void setDescription(String d) {
if(d!=null) {
d = d.trim();
if(d.startsWith("\"") && d.endsWith("\"")) {
d = d.substring(1, d.length()-1).trim();
***REMOVED***
***REMOVED***
this.description = d;
***REMOVED***
public String getCommand() {
return command;
***REMOVED***
@ -54,15 +67,15 @@ public class AddAlgorithmCommand {
***REMOVED***
public String getVRE() {
return vre;
return scope;
***REMOVED***
public String getP6() {
return p6;
public String getAlgorithmType() {
return algorithmType;
***REMOVED***
public String getP7() {
return p7;
public String getSkipjava() {
return skipJava;
***REMOVED***
public String getUrl() {
@ -76,12 +89,12 @@ public class AddAlgorithmCommand {
public String toString() {
String out = "";
out += String.format("%-12s: %s\n", "command", command);
out += String.format("%-12s: %s\n", "name", name);
out += String.format("%-12s: %s\n", "algo name", name);
out += String.format("%-12s: %s\n", "category", category);
out += String.format("%-12s: %s\n", "class", clazz);
out += String.format("%-12s: %s\n", "vre", vre);
out += String.format("%-12s: %s\n", "p6", p6);
out += String.format("%-12s: %s\n", "p7", p7);
out += String.format("%-12s: %s\n", "scope", scope);
out += String.format("%-12s: %s\n", "algo type", algorithmType);
out += String.format("%-12s: %s\n", "skip java", skipJava);
out += String.format("%-12s: %s\n", "url", url);
out += String.format("%-12s: %s\n", "description", this.description);
return out;

View File

@ -50,7 +50,9 @@ public class AlgorithmPackageParser {
return null;
***REMOVED*** else {
Map<String, List<String>> parsedMetadata = this.parseMetadata(packageMetadata);
return this.createAlgorithm(parsedMetadata);
Algorithm a = this.createAlgorithm(parsedMetadata);
a.setPackageURL(url);
return a;
***REMOVED***
***REMOVED***
@ -150,11 +152,9 @@ public class AlgorithmPackageParser {
private Algorithm createAlgorithm(Map<String, List<String>> metadata) {
Algorithm out = new Algorithm();
out.setName(extractSingleValue(metadata, METADATA_ALGORITHM_NAME));
out.setDescription(extractSingleValue(metadata,
METADATA_ALGORITHM_DESCRIPTION));
out.setDescription(extractSingleValue(metadata, METADATA_ALGORITHM_DESCRIPTION));
out.setClazz(extractSingleValue(metadata, METADATA_CLASS_NAME));
List<String> dependencies = extractMultipleValues(metadata,
METADATA_PACKAGES);
List<String> dependencies = extractMultipleValues(metadata, METADATA_PACKAGES);
if (dependencies != null) {
for (String pkg : dependencies) {
Dependency dep = new Dependency();