Skip to content

7.2.11

Clarive 7.2.11 Release Notes

Release date: 23 November 2018

We're pleased to present our new release Clarive 7.2.11. Mostly is a bugfix release but we have also include the following functionalities:

New event registration in ClaJS API

We have added the posibility to register events in plugins created with the ClaJS API

reg.register("event.my_new_plugin.my_named_event", {
    text: _("This is the text"),
    name: _("This is the long name"),
    description: _("This will be the description that you can see in the event log"),
    vars: ["my_variable"]
});

After registering events, you will be able to declare hooks for these new events as for any other standard Clarive event:

reg.beforeEvent("event.my_new_plugin.my_named_event", function() {
    console.log("My new event has been fired");
};

Fire event from ClaJS API

Now you can fire events from your own developed plugins

If you register a new event in your plugin, you probably also want to be able to fire it. This function fires events.

  • eventKey - the key string of the event we are firing, ie. event.myplugin.someevent.
  • eventData - any random data (Javascript object) from our plugin and related to the event that we want to share with rules or other extensions that may customize the event.
  • eventFunction - this is the core code that runs the event logic. This is optional, but it allows rules and other hooks to prevent it from executing. Data returned by the eventFunction will be merged into the eventData and will be accessible to after event hooks and rules (online and offline).

In the following example we register and fire an event:

var reg = require('cla/reg');

reg.register('event.myplugin.something', {
    name: 'Event fired when something happens'
});

// then later in your plugin...

reg.fireEvent(
    'event.myplugin.something',
    { foo: 123, bar: [1,2,3] },
    function(stash){
        console.log('This is the core of what happens in my event');
        console.log('Got foo here=' + stash.foo);

        // return values get pushed into the stash for event hooks to use
        return { result: 'this result goes back into the stash' };
    }
);

Registering and firing events in your plugin is a great way to enable user customization (with rules) and interop with other plugins. We recommend using it for any pluging features that you may deem extensible or customizable by others.

Warning

Do not fire Clarive's internal events from within your plugin! (example: event.topic.create) Unexpected things may happen. Use fireEvent for firing events your created in your plugin.

More improvements and issues resolved

  • [ENH] Optimization of cla/web JS module
  • [FIX] Pubsub enable option in config
  • [FIX] Milestones fieldlets date format
  • [FIX] Reports CSV export
  • [FIX] Topic update refresh cascade improvements
  • [FIX] Categories with UTF-8 names can't be opened
  • [FIX] Tar files operation with several includes are not including all files
  • [FIX] Environment assets attached to topics are not correctly checked out
  • [FIX] Notifications to "Emails"
  • [FIX] Transitions from Kanban are showing id status in topic activity
  • [FIX] Job daemon failing when job changeset removed
  • [FIX] Improve topic with parents save speed

Ready to upgrade?

Just follow the standard procedure for installing the new version. Click here to get it from our Install page.

Acknowledgements

Join us in our Community to make suggestions and report bugs.

Thanks to everyone who participated there.