Commit 5bf443a5 authored by Jörg Richter's avatar Jörg Richter

Java API: `ViewConfiguration` -> `View Config` (#341)

BREAKING CHANGE

Rename 2 interfaces:

    systems.dmx.core.ViewConfiguration            -> ViewConfig
    systems.dmx.core.model.ViewConfigurationModel -> ViewConfigModel
parent fdb897b6
Pipeline #10147 passed with stages
in 8 minutes and 45 seconds
......@@ -43,7 +43,7 @@ public interface CompDef extends Assoc {
// ---
ViewConfiguration getViewConfig();
ViewConfig getViewConfig();
// ---
......
......@@ -42,7 +42,7 @@ public interface DMXType extends Topic, Iterable<String> {
// === View Configuration ===
ViewConfiguration getViewConfig();
ViewConfig getViewConfig();
Object getViewConfigValue(String configTypeUri, String childTypeUri);
......
package systems.dmx.core;
import systems.dmx.core.model.TopicModel;
import systems.dmx.core.model.ViewConfigurationModel;
import systems.dmx.core.model.ViewConfigModel;
......@@ -13,7 +13,7 @@ import systems.dmx.core.model.ViewConfigurationModel;
*
* @author <a href="mailto:jri@deepamehta.de">Jörg Richter</a>
*/
public interface ViewConfiguration {
public interface ViewConfig {
Iterable<Topic> getConfigTopics();
......@@ -39,11 +39,11 @@ public interface ViewConfiguration {
* @param childTypeUri The child type URI of the config value to set, e.g. "dmx.webclient.icon"
* @param value The config value (String, Integer, Long, Double, or Boolean)
*/
ViewConfiguration setConfigValue(String configTypeUri, String childTypeUri, Object value);
ViewConfig setConfigValue(String configTypeUri, String childTypeUri, Object value);
ViewConfiguration setConfigValueRef(String configTypeUri, String childTypeUri, Object topicIdOrUri);
ViewConfig setConfigValueRef(String configTypeUri, String childTypeUri, Object topicIdOrUri);
// ---
ViewConfigurationModel getModel();
ViewConfigModel getModel();
}
package systems.dmx.core.impl;
import systems.dmx.core.CompDef;
import systems.dmx.core.ViewConfiguration;
import systems.dmx.core.ViewConfig;
import systems.dmx.core.model.CompDefModel;
import systems.dmx.core.model.PlayerModel;
......@@ -72,9 +72,9 @@ class CompDefImpl extends AssocImpl implements CompDef {
// ---
@Override
public ViewConfiguration getViewConfig() {
public ViewConfig getViewConfig() {
PlayerModel configurable = al.typeStorage.newCompDefPlayer(getId()); // ### ID is uninitialized
return new ViewConfigurationImpl(configurable, getModel().getViewConfig(), al);
return new ViewConfigImpl(configurable, getModel().getViewConfig(), al);
}
// ---
......
......@@ -5,7 +5,7 @@ import systems.dmx.core.model.ChildTopicsModel;
import systems.dmx.core.model.CompDefModel;
import systems.dmx.core.model.TopicModel;
import systems.dmx.core.model.TopicPlayerModel;
import systems.dmx.core.model.ViewConfigurationModel;
import systems.dmx.core.model.ViewConfigModel;
import org.codehaus.jettison.json.JSONObject;
......@@ -17,7 +17,7 @@ class CompDefModelImpl extends AssocModelImpl implements CompDefModel {
// ---------------------------------------------------------------------------------------------- Instance Variables
ViewConfigurationModelImpl viewConfig; // is never null
ViewConfigModelImpl viewConfig; // is never null
private Logger logger = Logger.getLogger(getClass().getName());
......@@ -30,9 +30,9 @@ class CompDefModelImpl extends AssocModelImpl implements CompDefModel {
/**
* @param assoc the underlying association.
*/
CompDefModelImpl(AssocModelImpl assoc, ViewConfigurationModelImpl viewConfig) {
CompDefModelImpl(AssocModelImpl assoc, ViewConfigModelImpl viewConfig) {
super(assoc);
this.viewConfig = viewConfig != null ? viewConfig : mf.newViewConfigurationModel();
this.viewConfig = viewConfig != null ? viewConfig : mf.newViewConfigModel();
// ### TODO: why null check? Compare to TypeModelImpl constructor -> see previous constructor
}
......@@ -72,7 +72,7 @@ class CompDefModelImpl extends AssocModelImpl implements CompDefModel {
}
@Override
public ViewConfigurationModelImpl getViewConfig() {
public ViewConfigModelImpl getViewConfig() {
return viewConfig;
}
......@@ -84,8 +84,8 @@ class CompDefModelImpl extends AssocModelImpl implements CompDefModel {
}
@Override
public void setViewConfig(ViewConfigurationModel viewConfig) {
this.viewConfig = (ViewConfigurationModelImpl) viewConfig;
public void setViewConfig(ViewConfigModel viewConfig) {
this.viewConfig = (ViewConfigModelImpl) viewConfig;
}
// ---
......
......@@ -2,7 +2,7 @@ package systems.dmx.core.impl;
import systems.dmx.core.CompDef;
import systems.dmx.core.DMXType;
import systems.dmx.core.ViewConfiguration;
import systems.dmx.core.ViewConfig;
import systems.dmx.core.model.CompDefModel;
import systems.dmx.core.model.PlayerModel;
import systems.dmx.core.model.TypeModel;
......@@ -87,9 +87,9 @@ abstract class DMXTypeImpl extends TopicImpl implements DMXType {
// === View Configuration ===
@Override
public final ViewConfiguration getViewConfig() {
public final ViewConfig getViewConfig() {
PlayerModel configurable = al.typeStorage.newTypePlayer(getId()); // ### type ID is uninitialized
return new ViewConfigurationImpl(configurable, getModel().getViewConfig(), al);
return new ViewConfigImpl(configurable, getModel().getViewConfig(), al);
}
@Override
......
......@@ -11,7 +11,7 @@ import systems.dmx.core.model.TopicModel;
import systems.dmx.core.model.TopicDeletionModel;
import systems.dmx.core.model.TopicPlayerModel;
import systems.dmx.core.model.TopicReferenceModel;
import systems.dmx.core.model.ViewConfigurationModel;
import systems.dmx.core.model.ViewConfigModel;
import systems.dmx.core.model.facets.FacetValueModel;
import systems.dmx.core.model.topicmaps.ViewAssoc;
import systems.dmx.core.model.topicmaps.ViewTopic;
......@@ -582,9 +582,8 @@ public class ModelFactoryImpl implements ModelFactory {
@Override
public TopicTypeModelImpl newTopicTypeModel(TopicModel typeTopic, String dataTypeUri, List<CompDefModel> compDefs,
ViewConfigurationModel viewConfig) {
return new TopicTypeModelImpl(newTypeModel(typeTopic, dataTypeUri, compDefs,
(ViewConfigurationModelImpl) viewConfig));
ViewConfigModel viewConfig) {
return new TopicTypeModelImpl(newTypeModel(typeTopic, dataTypeUri, compDefs, (ViewConfigModelImpl) viewConfig));
}
@Override
......@@ -607,9 +606,8 @@ public class ModelFactoryImpl implements ModelFactory {
@Override
public AssocTypeModelImpl newAssocTypeModel(TopicModel typeTopic, String dataTypeUri, List<CompDefModel> compDefs,
ViewConfigurationModel viewConfig) {
return new AssocTypeModelImpl(newTypeModel(typeTopic, dataTypeUri, compDefs,
(ViewConfigurationModelImpl) viewConfig));
ViewConfigModel viewConfig) {
return new AssocTypeModelImpl(newTypeModel(typeTopic, dataTypeUri, compDefs, (ViewConfigModelImpl) viewConfig));
}
@Override
......@@ -631,13 +629,13 @@ public class ModelFactoryImpl implements ModelFactory {
// === TypeModel ===
TypeModelImpl newTypeModel(TopicModel typeTopic, String dataTypeUri, List<CompDefModel> compDefs,
ViewConfigurationModelImpl viewConfig) {
ViewConfigModelImpl viewConfig) {
return new TypeModelImpl((TopicModelImpl) typeTopic, dataTypeUri, compDefs, viewConfig);
}
TypeModelImpl newTypeModel(String uri, String typeUri, SimpleValue value, String dataTypeUri) {
return new TypeModelImpl(newTopicModel(uri, typeUri, value), dataTypeUri, new ArrayList(),
newViewConfigurationModel());
newViewConfigModel());
}
TypeModelImpl newTypeModel(JSONObject typeModel) throws JSONException {
......@@ -645,7 +643,7 @@ public class ModelFactoryImpl implements ModelFactory {
return new TypeModelImpl(typeTopic,
typeModel.optString("dataTypeUri", null),
parseCompDefs(typeModel.optJSONArray("compDefs"), typeTopic.getUri()), // optJSONArray may return null
newViewConfigurationModel(typeModel.optJSONArray("viewConfigTopics"))); // optJSONArray may return null
newViewConfigModel(typeModel.optJSONArray("viewConfigTopics"))); // optJSONArray may return null
}
// ---
......@@ -675,7 +673,7 @@ public class ModelFactoryImpl implements ModelFactory {
@Override
public CompDefModelImpl newCompDefModel(String parentTypeUri, String childTypeUri,
String childCardinalityUri,
ViewConfigurationModel viewConfig) {
ViewConfigModel viewConfig) {
return newCompDefModel(-1, null, null, false, false, parentTypeUri, childTypeUri, childCardinalityUri,
viewConfig);
}
......@@ -694,8 +692,8 @@ public class ModelFactoryImpl implements ModelFactory {
* IMPORTANT: the association must identify its players <i>by URI</i> (not by ID). ### still true?
*/
@Override
public CompDefModelImpl newCompDefModel(AssocModel assoc, ViewConfigurationModel viewConfig) {
return new CompDefModelImpl((AssocModelImpl) assoc, (ViewConfigurationModelImpl) viewConfig);
public CompDefModelImpl newCompDefModel(AssocModel assoc, ViewConfigModel viewConfig) {
return new CompDefModelImpl((AssocModelImpl) assoc, (ViewConfigModelImpl) viewConfig);
}
@Override
......@@ -714,7 +712,7 @@ public class ModelFactoryImpl implements ModelFactory {
player2 != null ? player2 : childPlayer(compDef.getString("childTypeUri")),
null, childTopics(compDef)
),
newViewConfigurationModel(compDef.optJSONArray("viewConfigTopics"))
newViewConfigModel(compDef.optJSONArray("viewConfigTopics"))
);
} catch (Exception e) {
throw parsingFailed(compDef, e, "CompDefModelImpl");
......@@ -728,12 +726,12 @@ public class ModelFactoryImpl implements ModelFactory {
boolean isIdentityAttr, boolean includeInLabel,
String parentTypeUri, String childTypeUri,
String childCardinalityUri,
ViewConfigurationModel viewConfig) {
ViewConfigModel viewConfig) {
return new CompDefModelImpl(
newAssocModel(id, uri, COMPOSITION_DEF, parentPlayer(parentTypeUri), childPlayer(childTypeUri),
null, childTopics(childCardinalityUri, customAssocTypeUri, isIdentityAttr, includeInLabel) // value=null
),
(ViewConfigurationModelImpl) viewConfig
(ViewConfigModelImpl) viewConfig
);
}
......@@ -787,27 +785,27 @@ public class ModelFactoryImpl implements ModelFactory {
// === ViewConfigurationModel ===
// === ViewConfigModel ===
@Override
public ViewConfigurationModelImpl newViewConfigurationModel() {
return new ViewConfigurationModelImpl(new HashMap(), al());
public ViewConfigModelImpl newViewConfigModel() {
return new ViewConfigModelImpl(new HashMap(), al());
}
@Override
public ViewConfigurationModelImpl newViewConfigurationModel(Iterable<? extends TopicModel> configTopics) {
public ViewConfigModelImpl newViewConfigModel(Iterable<? extends TopicModel> configTopics) {
Map<String, TopicModelImpl> _configTopics = new HashMap();
for (TopicModel configTopic : configTopics) {
_configTopics.put(configTopic.getTypeUri(), (TopicModelImpl) configTopic);
}
return new ViewConfigurationModelImpl(_configTopics, al());
return new ViewConfigModelImpl(_configTopics, al());
}
/**
* @param configTopics may be null
*/
@Override
public ViewConfigurationModelImpl newViewConfigurationModel(JSONArray configTopics) {
public ViewConfigModelImpl newViewConfigModel(JSONArray configTopics) {
try {
Map<String, TopicModelImpl> _configTopics = new HashMap();
if (configTopics != null) {
......@@ -816,9 +814,9 @@ public class ModelFactoryImpl implements ModelFactory {
_configTopics.put(configTopic.getTypeUri(), configTopic);
}
}
return new ViewConfigurationModelImpl(_configTopics, al());
return new ViewConfigModelImpl(_configTopics, al());
} catch (Exception e) {
throw parsingFailed(configTopics, e, "ViewConfigurationModelImpl");
throw parsingFailed(configTopics, e, "ViewConfigModelImpl");
}
}
......
......@@ -6,7 +6,7 @@ import systems.dmx.core.model.AssocModel;
import systems.dmx.core.model.CompDefModel;
import systems.dmx.core.model.DMXObjectModel;
import systems.dmx.core.model.TypeModel;
import systems.dmx.core.model.ViewConfigurationModel;
import systems.dmx.core.model.ViewConfigModel;
import systems.dmx.core.service.Directive;
import systems.dmx.core.service.Directives;
import systems.dmx.core.util.SequencedHashMap;
......@@ -28,14 +28,14 @@ class TypeModelImpl extends TopicModelImpl implements TypeModel {
String dataTypeUri; // may be null in models used for an update operation
SequencedHashMap<String, CompDefModelImpl> compDefs; // is never null, may be empty
ViewConfigurationModelImpl viewConfig; // is never null
ViewConfigModelImpl viewConfig; // is never null
private Logger logger = Logger.getLogger(getClass().getName());
// ---------------------------------------------------------------------------------------------------- Constructors
TypeModelImpl(TopicModelImpl typeTopic, String dataTypeUri, List<CompDefModel> compDefs,
ViewConfigurationModelImpl viewConfig) {
ViewConfigModelImpl viewConfig) {
super(typeTopic);
this.dataTypeUri = dataTypeUri;
this.compDefs = toMap(compDefs);
......@@ -135,7 +135,7 @@ class TypeModelImpl extends TopicModelImpl implements TypeModel {
// === View Configuration ===
@Override
public ViewConfigurationModelImpl getViewConfig() {
public ViewConfigModelImpl getViewConfig() {
return viewConfig;
}
......@@ -145,8 +145,8 @@ class TypeModelImpl extends TopicModelImpl implements TypeModel {
}
@Override
public void setViewConfig(ViewConfigurationModel viewConfig) {
this.viewConfig = (ViewConfigurationModelImpl) viewConfig;
public void setViewConfig(ViewConfigModel viewConfig) {
this.viewConfig = (ViewConfigModelImpl) viewConfig;
}
......
......@@ -8,7 +8,7 @@ import systems.dmx.core.model.PlayerModel;
import systems.dmx.core.model.RelatedTopicModel;
import systems.dmx.core.model.SimpleValue;
import systems.dmx.core.model.TopicModel;
import systems.dmx.core.model.ViewConfigurationModel;
import systems.dmx.core.model.ViewConfigModel;
import systems.dmx.core.util.DMXUtils;
import java.util.ArrayList;
......@@ -284,7 +284,7 @@ class TypeStorage {
CompDefModelImpl newCompDefModel(AssocModelImpl assoc) {
return mf.newCompDefModel(
addPlayerUris(assoc, fetchParentTypeTopic(assoc).uri, fetchChildTypeTopic(assoc).uri),
mf.newViewConfigurationModel().addConfigTopic(
mf.newViewConfigModel().addConfigTopic(
// FIXME: the Core must not know about the Webclient
// FIXME: the view config topic label is not set
mf.newTopicModel("dmx.webclient.view_config", new SimpleValue("View Configuration"))
......@@ -649,7 +649,7 @@ class TypeStorage {
// ---
private ViewConfigurationModel fetchViewConfigOfType(TopicModel typeTopic) {
private ViewConfigModel fetchViewConfigOfType(TopicModel typeTopic) {
try {
return viewConfigModel(al.db.fetchTopicRelatedTopics(typeTopic.getId(), COMPOSITION,
PARENT, CHILD, "dmx.webclient.view_config"));
......@@ -658,7 +658,7 @@ class TypeStorage {
}
}
private ViewConfigurationModel fetchViewConfigOfCompDef(AssocModel compDef) {
private ViewConfigModel fetchViewConfigOfCompDef(AssocModel compDef) {
try {
return viewConfigModel(al.db.fetchAssocRelatedTopics(compDef.getId(), COMPOSITION,
PARENT, CHILD, "dmx.webclient.view_config"));
......@@ -673,15 +673,15 @@ class TypeStorage {
* Creates a view config model from a bunch of config topics.
* Loads the child topics of the given topics and updates them in-place.
*/
private ViewConfigurationModel viewConfigModel(Iterable<? extends TopicModelImpl> configTopics) {
private ViewConfigModel viewConfigModel(Iterable<? extends TopicModelImpl> configTopics) {
loadChildTopics(configTopics);
return mf.newViewConfigurationModel(configTopics);
return mf.newViewConfigModel(configTopics);
}
// --- Store ---
private void storeViewConfig(TypeModelImpl type) {
ViewConfigurationModelImpl viewConfig = type.viewConfig;
ViewConfigModelImpl viewConfig = type.viewConfig;
TopicModel configTopic = _storeViewConfig(newTypePlayer(type.id), viewConfig);
// Note: cached view config must be overridden with the "real thing". Otherwise the child assocs
// would be missing on a cold start. Subsequent migrations operating on them would fail.
......@@ -691,7 +691,7 @@ class TypeStorage {
}
void storeViewConfig(CompDefModelImpl compDef) {
ViewConfigurationModelImpl viewConfig = compDef.viewConfig;
ViewConfigModelImpl viewConfig = compDef.viewConfig;
TopicModel configTopic = _storeViewConfig(newCompDefPlayer(compDef.id), viewConfig);
// Note: cached view config must be overridden with the "real thing". Otherwise the child assocs
// would be missing on a cold start. Subsequent migrations operating on them would fail.
......@@ -703,7 +703,7 @@ class TypeStorage {
/**
* @return may be null
*/
private TopicModel _storeViewConfig(PlayerModel configurable, ViewConfigurationModelImpl viewConfig) {
private TopicModel _storeViewConfig(PlayerModel configurable, ViewConfigModelImpl viewConfig) {
try {
TopicModel topic = null;
for (TopicModelImpl configTopic : viewConfig.getConfigTopics()) {
......
package systems.dmx.core.impl;
import systems.dmx.core.Topic;
import systems.dmx.core.ViewConfiguration;
import systems.dmx.core.ViewConfig;
import systems.dmx.core.model.ChildTopicsModel;
import systems.dmx.core.model.PlayerModel;
import systems.dmx.core.model.TopicModel;
import systems.dmx.core.model.ViewConfigurationModel;
import systems.dmx.core.model.ViewConfigModel;
/**
* A view configuration that is attached to the {@link AccessLayer}.
*/
class ViewConfigurationImpl implements ViewConfiguration {
class ViewConfigImpl implements ViewConfig {
// ---------------------------------------------------------------------------------------------- Instance Variables
/**
* The underlying model.
*/
private ViewConfigurationModelImpl model;
private ViewConfigModelImpl model;
/**
* A player that points to the object this view configuration applies to.
......@@ -32,7 +32,7 @@ class ViewConfigurationImpl implements ViewConfiguration {
// ---------------------------------------------------------------------------------------------------- Constructors
ViewConfigurationImpl(PlayerModel configurable, ViewConfigurationModelImpl model, AccessLayer al) {
ViewConfigImpl(PlayerModel configurable, ViewConfigModelImpl model, AccessLayer al) {
this.configurable = configurable;
this.model = model;
this.al = al;
......@@ -43,7 +43,7 @@ class ViewConfigurationImpl implements ViewConfiguration {
// === ViewConfiguration Implementation ===
// === ViewConfig Implementation ===
@Override
public Iterable<Topic> getConfigTopics() {
......@@ -64,14 +64,14 @@ class ViewConfigurationImpl implements ViewConfiguration {
}
@Override
public ViewConfiguration setConfigValue(String configTypeUri, String childTypeUri, Object value) {
public ViewConfig setConfigValue(String configTypeUri, String childTypeUri, Object value) {
_setConfigValue(configTypeUri, mf.newChildTopicsModel()
.set(childTypeUri, value));
return this;
}
@Override
public ViewConfiguration setConfigValueRef(String configTypeUri, String childTypeUri, Object topicIdOrUri) {
public ViewConfig setConfigValueRef(String configTypeUri, String childTypeUri, Object topicIdOrUri) {
_setConfigValue(configTypeUri, mf.newChildTopicsModel()
.set(childTypeUri, mf.newTopicReferenceModel(topicIdOrUri)));
return this;
......@@ -80,7 +80,7 @@ class ViewConfigurationImpl implements ViewConfiguration {
// ---
@Override
public ViewConfigurationModel getModel() {
public ViewConfigModel getModel() {
return model;
}
......
......@@ -2,7 +2,7 @@ package systems.dmx.core.impl;
import systems.dmx.core.model.RelatedTopicModel;
import systems.dmx.core.model.TopicModel;
import systems.dmx.core.model.ViewConfigurationModel;
import systems.dmx.core.model.ViewConfigModel;
import org.codehaus.jettison.json.JSONArray;
......@@ -11,7 +11,7 @@ import java.util.logging.Logger;
class ViewConfigurationModelImpl implements ViewConfigurationModel {
class ViewConfigModelImpl implements ViewConfigModel {
// ---------------------------------------------------------------------------------------------- Instance Variables
......@@ -28,7 +28,7 @@ class ViewConfigurationModelImpl implements ViewConfigurationModel {
/**
* @param configTopics must not be null
*/
ViewConfigurationModelImpl(Map<String, TopicModelImpl> configTopics, AccessLayer al) {
ViewConfigModelImpl(Map<String, TopicModelImpl> configTopics, AccessLayer al) {
this.configTopics = configTopics;
this.mf = al.mf;
}
......@@ -46,7 +46,7 @@ class ViewConfigurationModelImpl implements ViewConfigurationModel {
}
@Override
public ViewConfigurationModel addConfigTopic(TopicModel configTopic) {
public ViewConfigModel addConfigTopic(TopicModel configTopic) {
// error check
String configTypeUri = configTopic.getTypeUri();
if (getConfigTopic(configTypeUri) != null) {
......@@ -71,7 +71,7 @@ class ViewConfigurationModelImpl implements ViewConfigurationModel {
// ---
@Override
public ViewConfigurationModel setConfigValue(String configTypeUri, String childTypeUri, Object value) {
public ViewConfigModel setConfigValue(String configTypeUri, String childTypeUri, Object value) {
TopicModel configTopic = getConfigTopic(configTypeUri);
if (configTopic == null) {
addConfigTopic(mf.newTopicModel(configTypeUri, mf.newChildTopicsModel().set(childTypeUri, value)));
......@@ -82,7 +82,7 @@ class ViewConfigurationModelImpl implements ViewConfigurationModel {
}
@Override
public ViewConfigurationModel setConfigValueRef(String configTypeUri, String childTypeUri, Object topicIdOrUri) {
public ViewConfigModel setConfigValueRef(String configTypeUri, String childTypeUri, Object topicIdOrUri) {
TopicModel configTopic = getConfigTopic(configTypeUri);
RelatedTopicModel valueRef = mf.newTopicReferenceModel(topicIdOrUri);
if (configTopic == null) {
......
......@@ -31,12 +31,12 @@ public interface CompDefModel extends AssocModel {
String getChildCardinalityUri();
ViewConfigurationModel getViewConfig();
ViewConfigModel getViewConfig();
// ---
// TODO: currently not supported. Drop from public API?
void setChildCardinalityUri(String childCardinalityUri);
void setViewConfig(ViewConfigurationModel viewConfig);
void setViewConfig(ViewConfigModel viewConfig);
}
......@@ -46,11 +46,11 @@ public interface TypeModel extends TopicModel, Iterable<String> {
// === View Configuration ===
ViewConfigurationModel getViewConfig();
ViewConfigModel getViewConfig();
// TODO: server-side operations on the view config settings possibly suggest they are not acually
// view config settings but part of the core type model.
Object getViewConfigValue(String configTypeUri, String childTypeUri);
void setViewConfig(ViewConfigurationModel viewConfig);
void setViewConfig(ViewConfigModel viewConfig);
}
......@@ -12,7 +12,7 @@ import org.codehaus.jettison.json.JSONArray;
*
* @author <a href="mailto:jri@deepamehta.de">Jörg Richter</a>
*/
public interface ViewConfigurationModel {
public interface ViewConfigModel {
Iterable<? extends TopicModel> getConfigTopics();
......@@ -26,7 +26,7 @@ public interface ViewConfigurationModel {
*
* @throws RuntimeException if this view config already contains a config topic for that type URI.
*/
ViewConfigurationModel addConfigTopic(TopicModel configTopic);
ViewConfigModel addConfigTopic(TopicModel configTopic);
/**
* Overrides a config topic with the given one.
......@@ -45,9 +45,9 @@ public interface ViewConfigurationModel {
* @param childTypeUri The child type URI of the config value to set, e.g. "dmx.webclient.icon"
* @param value The config value (String, Integer, Long, Double, or Boolean)
*/
ViewConfigurationModel setConfigValue(String configTypeUri, String childTypeUri, Object value);
ViewConfigModel setConfigValue(String configTypeUri, String childTypeUri, Object value);
ViewConfigurationModel setConfigValueRef(String configTypeUri, String childTypeUri, Object topicIdOrUri);
ViewConfigModel setConfigValueRef(String configTypeUri, String childTypeUri, Object topicIdOrUri);
// ---
......
......@@ -16,7 +16,7 @@ import systems.dmx.core.model.TopicPlayerModel;
import systems.dmx.core.model.TopicReferenceModel;
import systems.dmx.core.model.TopicTypeModel;
import systems.dmx.core.model.TypeModel;
import systems.dmx.core.model.ViewConfigurationModel;
import systems.dmx.core.model.ViewConfigModel;
import systems.dmx.core.model.facets.FacetValueModel;
import systems.dmx.core.model.topicmaps.ViewAssoc;
import systems.dmx.core.model.topicmaps.ViewTopic;
......@@ -181,7 +181,7 @@ public interface ModelFactory {
// === TopicTypeModel ===
TopicTypeModel newTopicTypeModel(TopicModel typeTopic, String dataTypeUri, List<CompDefModel> compDefs,
ViewConfigurationModel viewConfig);
ViewConfigModel viewConfig);
TopicTypeModel newTopicTypeModel(String uri, String value, String dataTypeUri);
......@@ -192,7 +192,7 @@ public interface ModelFactory {
// === AssocTypeModel ===
AssocTypeModel newAssocTypeModel(TopicModel typeTopic, String dataTypeUri, List<CompDefModel> compDefs,
ViewConfigurationModel viewConfig);
ViewConfigModel viewConfig);
AssocTypeModel newAssocTypeModel(String uri, String value, String dataTypeUri);
......@@ -205,24 +205,24 @@ public interface ModelFactory {
CompDefModel newCompDefModel(String parentTypeUri, String childTypeUri, String childCardinalityUri);
CompDefModel newCompDefModel(String parentTypeUri, String childTypeUri, String childCardinalityUri,
ViewConfigurationModel viewConfig);
ViewConfigModel viewConfig);
CompDefModel newCompDefModel(String customAssocTypeUri, boolean isIdentityAttr, boolean includeInLabel,
String parentTypeUri, String childTypeUri, String childCardinalityUri);
CompDefModel newCompDefModel(AssocModel assoc, ViewConfigurationModel viewConfig);
CompDefModel newCompDefModel(AssocModel assoc, ViewConfigModel viewConfig);
CompDefModel newCompDefModel(JSONObject compDef);
// === ViewConfigurationModel ===
// === ViewConfigModel ===
ViewConfigurationModel newViewConfigurationModel();
ViewConfigModel newViewConfigModel();
ViewConfigurationModel newViewConfigurationModel(Iterable<? extends TopicModel> configTopics);
ViewConfigModel newViewConfigModel(Iterable<? extends TopicModel> configTopics);
ViewConfigurationModel newViewConfigurationModel(JSONArray configTopics);
ViewConfigModel newViewConfigModel(JSONArray configTopics);
......
......@@ -8,7 +8,7 @@
</div>
<div class="field">
<div class="field-label">Released</div>
May 1, 2020
May 11, 2020
</div>
<div class="field">
<div class="field-label">License</div>
......
......@@ -6,13 +6,13 @@ import systems.dmx.core.AssocType;
import systems.dmx.core.DMXType;
import systems.dmx.core.Topic;
import systems.dmx.core.TopicType;
import systems.dmx.core.ViewConfiguration;
import systems.dmx.core.ViewConfig;
import systems.dmx.core.model.AssocTypeModel;
import systems.dmx.core.model.CompDefModel;
import systems.dmx.core.model.TopicModel;
import systems.dmx.core.model.TopicTypeModel;
import systems.dmx.core.model.TypeModel;
import systems.dmx.core.model.ViewConfigurationModel;
import systems.dmx.core.model.ViewConfigModel;
import systems.dmx.core.osgi.PluginActivator;
import systems.dmx.core.service.Directive;
import systems.dmx.core.service.Directives;
......@@ -177,7 +177,7 @@ public class WebclientPlugin extends PluginActivator implements AllPluginsActive
* Overrides the cached view config topic for the given type/comp def with the given view config topic.
*/
private void updateTypeCache(TypeModel type, long compDefId, TopicModel viewConfigTopic) {
ViewConfigurationModel vcm;
ViewConfigModel vcm;
if (compDefId == -1) {
vcm = type.getViewConfig();
} else {
......@@ -197,7 +197,7 @@ public class WebclientPlugin extends PluginActivator implements AllPluginsActive
}
}
private void setViewConfigLabel(ViewConfiguration viewConfig) {
private void setViewConfigLabel(ViewConfig viewConfig) {
for (Topic configTopic : viewConfig.getConfigTopics()) {
setDefaultConfigTopicLabel(configTopic);
}
......@@ -224,7 +224,7 @@ public class WebclientPlugin extends PluginActivator implements AllPluginsActive
}
}