Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Codeblock
languagebash
umkickstarter -n de.pinuts.tutorial
cd umkickstarter
# Copy your partner license file to env/devel/cmsbs-conf/cmsbs.license

Include dependency

Edit build.gradle and add the following dependency:

Codeblock
languagegroovy
dependencies {
    ...
    
    runtime('de.pinuts.cmsbs:SyncQueue:1.3.5')
}

Now, setup and restart:

Codeblock
languagebash
gradle setup run

Implement and register CommitCallback

Create a new (M)JS file: cmsbs-conf/cse/plugins/de.pinuts.tutorial/shared/CommitCallback.mjs:

Codeblock
languagejs
/// <reference path="../../../.vscode.js"/>

class MyCommitCallback extends CommitCallback {
    /**
     * @param {Entry} e 
     */
    preCommit(e) {
        if (e.get('entrytype') == 'customer') {
            console.error('preCommit:', e);
        }
    }

    /**
     * @param {Entry} e 
     */
    postCommit(e) {
        if (e.get('entrytype') == 'customer') {
            console.error('postCommit:', e);
        }
    }

    /**
     * @param {Entry} e 
     */
    preRemove(e) {
        if (e.get('entrytype') == 'customer') {
            console.error('preRemove:', e);
        }
    }
}

CommitCallback.registerCallback(() => new MyCommitCallback());

Open http://localhost:8080/cmsbs, login as admin / admin and create, edit and delete a Customer entry.

Take a look at the console / shell where you started the UM: