Commit 487ec2c5 authored by Jörg Richter's avatar Jörg Richter

DMXUtils API: rename -> `assocAutoTyping()` (#341)

BREAKING CHANGE

Rename 1 method in systems.dmx.core.util.DMXUtils

    `associationAutoTyping()` -> `assocAutoTyping()`
parent b0c83a0d
Pipeline #10052 passed with stages
in 8 minutes and 4 seconds
......@@ -45,7 +45,7 @@ public class ContactsPlugin extends PluginActivator implements ContactsService,
@Override
public void preCreateAssoc(AssocModel assoc) {
// Person <-> Organization
DMXUtils.associationAutoTyping(assoc, "dmx.contacts.person", "dmx.contacts.organization",
DMXUtils.assocAutoTyping(assoc, "dmx.contacts.person", "dmx.contacts.organization",
"dmx.contacts.organization_involvement", DEFAULT, DEFAULT);
}
}
......@@ -293,10 +293,8 @@ public class AssocModelImpl extends DMXObjectModelImpl implements AssocModel {
void preCreate() {
// Note: auto-typing only works for generic assocs (of type "Association") and for by-ID players.
// That's why auto-typing does not interfere with comp defs created programmatically (through migration).
if (DMXUtils.associationAutoTyping(this, TOPIC_TYPE, TOPIC_TYPE, COMPOSITION_DEF, CHILD_TYPE, PARENT_TYPE)
!= null ||
DMXUtils.associationAutoTyping(this, TOPIC_TYPE, ASSOC_TYPE, COMPOSITION_DEF, CHILD_TYPE, PARENT_TYPE)
!= null) {
if (DMXUtils.assocAutoTyping(this, TOPIC_TYPE, TOPIC_TYPE, COMPOSITION_DEF, CHILD_TYPE, PARENT_TYPE) != null ||
DMXUtils.assocAutoTyping(this, TOPIC_TYPE, ASSOC_TYPE, COMPOSITION_DEF, CHILD_TYPE, PARENT_TYPE) != null) {
childTopics.setRef(CARDINALITY, ONE);
}
//
......
......@@ -200,8 +200,8 @@ public class DMXUtils {
* <code>null</code> otherwise. Convenience to access the assoc's players after retyping.
* Element 0 is the player of "topicTypeUri1", Element 1 is the player of "topicTypeUri2".
*/
public static PlayerModel[] associationAutoTyping(AssocModel assoc, String topicTypeUri1, String topicTypeUri2,
String assocTypeUri, String roleTypeUri1, String roleTypeUri2) {
public static PlayerModel[] assocAutoTyping(AssocModel assoc, String topicTypeUri1, String topicTypeUri2,
String assocTypeUri, String roleTypeUri1, String roleTypeUri2) {
if (!assoc.getTypeUri().equals(ASSOCIATION)) {
return null;
}
......
......@@ -59,15 +59,15 @@ public class EventsPlugin extends PluginActivator implements EventsService, PreC
@Override
public void preCreateAssoc(AssocModel assoc) {
// Event <-> Person
DMXUtils.associationAutoTyping(assoc, "dmx.events.event", "dmx.contacts.person",
"dmx.events.event_involvement", DEFAULT, DEFAULT);
DMXUtils.assocAutoTyping(assoc, "dmx.events.event", "dmx.contacts.person", "dmx.events.event_involvement",
DEFAULT, DEFAULT);
// Event <-> Organization
DMXUtils.associationAutoTyping(assoc, "dmx.events.event", "dmx.contacts.organization",
"dmx.events.event_involvement", DEFAULT, DEFAULT);
DMXUtils.assocAutoTyping(assoc, "dmx.events.event", "dmx.contacts.organization", "dmx.events.event_involvement",
DEFAULT, DEFAULT);
//
// Event -> Address
PlayerModel[] players = DMXUtils.associationAutoTyping(assoc, "dmx.events.event", "dmx.contacts.address",
COMPOSITION, PARENT, CHILD);
PlayerModel[] players = DMXUtils.assocAutoTyping(assoc, "dmx.events.event", "dmx.contacts.address", COMPOSITION,
PARENT, CHILD);
if (players != null) {
long eventId = players[0].getId();
Topic event = dmx.getTopic(eventId);
......
......@@ -8,7 +8,7 @@
</div>
<div class="field">
<div class="field-label">Released</div>
Apr 29, 2020
Apr 30, 2020
</div>
<div class="field">
<div class="field-label">License</div>
......
......@@ -9,7 +9,7 @@ import extraElementUI from './element-ui'
import 'font-awesome/css/font-awesome.css'
import './websocket'
console.log('[DMX] 2020/04/29')
console.log('[DMX] 2020/04/30')
// 1) Init dm5 library
// The dm5 library must be inited *before* the dm5-webclient component is instantiated.
......
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