mukil / dmx-webpages

Webpages is a visual multi-site CMS for authoring HTML in collaboration based on DMX.
http://mikromedia.de/typebox-cms
GNU Affero General Public License v3.0
3 stars 2 forks source link

Implement custom commands on Webpage, Website and Username topics #21

Closed mukil closed 3 years ago

mukil commented 3 years ago

Hey @jri

in DM4 I made use of the webclient state and some webclient services and I would be glad for some pointers so I can adapt my plugin efficiently to run in the DMX Webclient.

I guess, the payload models might have changed slightly syntactically (not using frankenstein notation, and other URIs), but the same functionality is exposed by the dmx-webclient or dmx-topicmaps module in form of Vuex "actions", right?

  1. Here is the webclient state I utilized in DM4

    dm4c.selected_object
    // -> to inspect "children"

    I guess the same object - only managed by the Vuex store now - is still available e.g. somewhere like store.topicmaps.selected_object, correct?

  2. Furthermore I used the following calls in combination to add custom webpages functionality to the Webclient:

    2.1: dm4c.do_reveal_topic(id, "show")
    2.2: dm4c.do_reveal_related_topic(id, "show")
    2.3: dm4c.create_topic("de.mikromedia.page")
    2.4: dm4c.create_assoc("dmx.core.association",
    {topic_id: webpage.id, role_type_uri: "dmx.core.default"},
    {topic_id: section.id, role_type_uri: "dmx.core.default"}
    )
    2.5: dm4c.show_topic(section, "edit", undefined, true) // do_center=true
    2.6: dm4c.show_association(assoc, "none")
    2.7: dm4c.get_topic_related_topics(webpageId, {
    "assoc_type": "dmx.core.association",
    "others_topic_type_uri": "de.mikromedia.site"
    }, false)

I would be glad for some support e.g. links to follow so I could read about how to adapt my webclient extensions without much trial and error.

Furthermore I asked myself

  1. if I have access to a Vue instance in (3.a) my plugin.js and (3.b) my `plugin_store.js" to invoke ElementUI notify method, like "this.$notify" directly not being within a vue template.

I would be very thankful for your support here!

mukil commented 3 years ago

For answers to most of the questions above, find this forum posting: https://forum.dmx.systems/t/implementing-custom-commands-with-plugin-js-utilizing-webclient-state-and-the-dmx-api/99/13