Skip to content
Snippets Groups Projects
Commit 5b6fda29 authored by Eike Cochu's avatar Eike Cochu
Browse files

updated cmd, can now concatenate more commands

updated cmd, scanning for selected models when needed instead of at beginning
added last generated date to topic models
parent 5cc739ac
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,6 @@ public class CommandLineOptions {
public void parse(final String[] args) throws ParseException {
cmd = new DefaultParser().parse(options, args);
checkDependencies();
}
public boolean hasOption(final Option opt) {
......@@ -149,18 +148,16 @@ public class CommandLineOptions {
}
public String[] selectedModels() {
String[] models = null;
if (isAll())
return new String[] { "all" };
else
return getOptionValues(SELECT);
}
models = new String[] { "all" };
else if (isSelect())
models = getOptionValues(SELECT);
if (models != null && models.length > 0)
return models;
private void checkDependencies() throws ParseException {
if (isImport() || isModel() || isIndex() || isReread()) {
// these options require at least one selected model
if (!isSelect() && !isAll())
throw new ParseException("select at least one model");
}
throw new RuntimeException("select at least one model");
}
}
......@@ -9,6 +9,7 @@ import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import org.bson.types.ObjectId;
......@@ -425,6 +426,7 @@ public class Analyzer {
}
}
topicModel.setLastGenerated(new Date());
dbTopicModels.replaceSingle(topicModel);
}
......
......@@ -102,6 +102,7 @@
<button type="button" class="list-group-item topic-model" ng-repeat="topicModel in topicModels" ng-click="changeTopicModel(topicModel)" ng-class="{'active selected-model':rootModels.topicModel.id===topicModel.id}">
<span class="badge" ng-bind="topicModel.articleCount" ng-show="topicModel.articleCount" ng-attr-title="{{topicModel.articleCount + ' article(s)'}}"></span>
<span class="badge" ng-bind="topicModel.topicCount" ng-show="topicModel.topicCount" ng-attr-title="{{topicModel.topicCount + ' topic(s)'}}"></span>
<span class="badge" ng-if="!topicModel.lastGenerated" title="Model was never generated">Non-generated</span>
<span ng-bind="topicModel.id"></span>
<br ng-show="topicModel.modelConfig.description">
<small ng-bind="topicModel.modelConfig.description"></small>
......
package de.vipra.util.model;
import java.io.Serializable;
import java.util.Date;
import org.mongodb.morphia.annotations.Embedded;
import org.mongodb.morphia.annotations.Entity;
......@@ -26,6 +27,8 @@ public class TopicModelFull implements Model<String>, Comparable<TopicModelFull>
private int windowCount;
private Date lastGenerated;
@Embedded
@QueryIgnore(multi = true)
private TopicModelConfig modelConfig;
......@@ -91,6 +94,14 @@ public class TopicModelFull implements Model<String>, Comparable<TopicModelFull>
this.modelConfig = modelConfig;
}
public Date getLastGenerated() {
return lastGenerated;
}
public void setLastGenerated(Date lastGenerated) {
this.lastGenerated = lastGenerated;
}
@Override
public int compareTo(final TopicModelFull o) {
return id.compareTo(o.getId());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment