Ticket #636 (closed Enhancement: fixed)

Opened 7 years ago

Last modified 5 years ago

Simplify format of create topic requests and declarative migrations

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.6
Component: DeepaMehta Standard Distribution Version: 4.2
Keywords: Cc: dgf, Malte, JuergeN
Complexity: 3 Area: Application Framework / API
Module: deepamehta-core

Description (last modified by jri) (diff)

When creating composite topics the child topic's type_uri is implicit and should not be required to be specified.

Example:

{
    type_uri: "my.parent.type"
    childs: {
        "my.child.type": {
            uri: "child.topic.uri",
            type_uri: "my.child.type",    ### this line should not be required
            value: "Hi!"
        }
    }
}

Note: in this example the child topic is supposed to get an explicit URI, that's why the canonic topic format (id, uri, type_uri, value, childs) must be used here. This ticket refers to the canonic topic format only.

Just to remember: if your application does not rely on specific topic URIs, the simplified topic format could be used anyway. In this case there is no redundant type_uri:

{
    type_uri: "my.parent.type"
    childs: {
        "my.child.type": "Hi!"
    }
}

This works for composite child topics as well:

{
    type_uri: "dm4.contacts.person"
    childs: {
        "dm4.contacts.person_name": {
            "dm4.contacts.first_name": "Paul",
            "dm4.contacts.last_name": "Morrison"
        }
    }
}

Change History

comment:1 Changed 7 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 7 years ago by jri

  • Milestone changed from Release 4.3 to Release 4.4

comment:3 Changed 6 years ago by jri

  • Cc JuergeN added
  • Description modified (diff)
  • Milestone changed from Release 4.4 to Release 4.6

comment:4 Changed 6 years ago by Jörg Richter <jri@…>

In 157026162c777471cfe3aed61288f5ce36503262/deepamehta:

Core: simplify request format (#636).

When creating child topics using the "canonic" format the child topic's type_uri must no longer be specified (as it is redundant).

Example:

{
    type_uri: "my.parent.type"
    childs: {
        "my.child.type": {
            uri: "child.topic.uri",
            type_uri: "my.child.type",    ### this line is no longer required and can be dropped
            value: "Hi!"
        }
    }
}

See #636.

comment:5 Changed 6 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed

comment:6 Changed 5 years ago by Jörg Richter <jri@…>

In 1622a50872eacd4708426327bf80ac230150dd27/deepamehta:

Changing passwords work again (#795).

Background: since DM 4.6 the REST API and declarative migrations support a simplified format for create/update requests. The child topic's type_uri must no longer be specified as it is redundant (see #636). The type_uri field is initialized by the server automatically.

The DM 4.6 Webclient made use of the simplified format and did not initialze the topic's type_uri in update requests. This broke the working of plugins which register a listener for the client-side pre_update_topic event as most plugins do work based on the topic's type there.

The Access Control plugin uses the pre_update_topic listener to encode a changed password at client-side before it is send to the server.

Now with this fix the topic/assoc passed to the pre_update_topic/pre_update_association listeners is again guaranteed to have its type_uri field initialized.

See #795.

Note: See TracTickets for help on using tickets.