Releases: vaadin/collaboration-kit
Collaboration Engine 5.2.0.beta1
No changes since 5.2.0.alpha2
Collaboration Engine 5.2.0.alpha2
New Collaboration List operation
ListOperation now supports the moveBefore, moveAfter and moveBetween operations.
ListOperation op = ListOperation.moveBetween(keyToMove, keyBefore, keyAfter);
list.apply(op).getCompletableFuture().thenAccept(success -> {
if (success) {
log("Operation applied");
} else {
log("Operation failed");
}
});This will move the value of keyToMove so that it is between keyBefore and keyAfter if and only if keyBefore is currently the previous item to keyAfter.
Other changes since 5.2.0.alpha1
- Fixes
- Upgrade to license checker 1.5.1
- Make user colors consistent across a clustered environment
Collaboration Engine 5.2.0.alpha1
This is the first pre-release of Collaboration Engine 5.2.
New Collaboration List operation and condition
ListOperation now supports the set operation and a new ifValue condition.
ListOperation op = ListOperation.set(key, "bar").ifValue(key, "foo");
list.apply(op).getCompletableFuture().thenAccept(success -> {
if (success) {
log("Operation applied");
} else {
log("Operation failed");
}
});This will change the value of the key to "bar" if and only if the current value of that key is "foo".
New convenience method in the avatar group component
CollaborationAvatarGroup now provides a method that returns an avatar for the local user.
Given an instance of CollaborationAvatarGroup:
Avatar avatar = avatarGroup.createOwnAvatar();Collaboration Engine 5.1.1
No changes since 5.1.0
Collaboration Engine 5.1.0
This is the final release of Collaboration Engine 5.1, which brings the FormManager and a new API for CollaborationList advanced operations. It also introduces the experimental Backend API to provide support to run Collaboration Engine in clustered environments.
Collaboration Engine 5.1 is part of Vaadin 23.1.
Manage Form Values and Field Highlighting
Collaboration Engine now includes the FormManager to set property values and field highlighting in a form, and to react to changes in fields and highlight state. It is a mid-level API and it provides a simple way to create a custom form component with collaborative features.
The manager can be used in conjunction with a CollaborationBinder connected to the same topic: any changes made to property values or highlighting via the FormManager will be reflected in any fields bound to the same properties, and vice versa.
Here some examples on how to use the FormManager:
UserInfo localUser = new UserInfo("john");
FormManager manager = new FormManager(form, localUser, "my-topic");
manager.highlight("name", true);
manager.setHighlightHandler(context -> {
String propertyName = context.getPropertyName();
UserInfo user = context.getUser();
// Executed when a field is highlighted
return () -> {
// Executed when a field is no longer highlighted
};
});
manager.setValue("name", "John");
manager.setPropertyChangeHandler(event -> {
String propertyName = event.getPropertyName();
Object value = event.getValue();
// Executed when a property value is changed
});Latest documentation: https://vaadin.com/docs/latest/ce/managers/form-manager
Conditional list operations
The ListOperation class allows you to prepare a list operation that can then be applied to the list using the CollaborationList::apply method.
The reason you may want to use this class is to define certain conditions that must be met when the operation is attempted. If a condition is not met, the operation will not be completed. This is useful to protect against duplicate operations.
Currently supported static methods in ListOperation:
insertFirst(value):valuewill be inserted at the beginning of the list.insertLast(value):valuewill be inserted at the end of the list.insertBefore(key, value):valuewill be inserted immediately before a specified key.insertAfter(key, value):valuewill be inserted immediately after a specified key.insertBetween(keyBefore, keyAfter, value): shorthand forinsertAfter(value, keyBefore).ifNext(keyBefore, keyAfter).
Methods to add conditions to the list operation:
ifFirst(key): the specifiedkeymust be the first in the list.ifLast(key): the specifiedkeymust be the last in the list.ifPrev(key, keyPrev): the specifiedkeyPrevmust be immediately beforekey.ifNext(key, keyNext): the specifiedkeyNextmust be immediately afterkey.ifEmpty(): the list must have no entries.ifNotEmpty(): the list must have at least one entry.
The operation can also be scoped to the current connection with the method withScope(scope).
Latest documentation: https://vaadin.com/docs/latest/ce/advanced/collaboration-list/#advanced-list-operations
Clustering Support with the Backend API (experimental)
Using Collaboration Engine in an application running in a clustered environment would result in users being able to collaborate only with others connected to the same app instance. To properly run clustered application deployments, Collaboration Engine now provides the Backend superclass that can be extended to support such multi-instance environments.
Latest documentation: https://vaadin.com/docs/latest/ce/advanced/backend-api
Other new features
CollaborationListnow has two new methods:moveBefore(key, keyToMove)andmoveAfter(key, keyToMove).
Fixes
- Check if a named map exists before clearing on expiration [#55]
- Prevent "UI detached" exception on session expiration
- Preserve the order of actions in collaboration maps and lists
- Properly deactivate connections on shutdown
Collaboration Engine 5.1.0.rc2
No changes since 5.1.0.rc1
Collaboration Engine 5.1.0.rc1
Changes since 5.1.0.beta2
- New Features:
- Backend event-log truncation: this adds the ability to truncate event-logs to grow infinitely
Collaboration Engine 5.1.0.beta2
Changes since 5.1.0.beta1
- New Features:
- Add
FormManagerconstructor overload with a component argument. - Put Backend API behind a feature flag.
To provide custom implementations of theBackendinterface, the new feature flagcom.vaadin.experimental.collaborationEngineBackendshould be enabled.
- Add
Collaboration Engine 5.1.0.beta1
Changes since 5.1.0.alpha4
- Security Fixes:
- Bump Jackson dependencies to fix vulnerabilities.
- Breaking Changes:
- Turn
Backendinto an abstract class.
- Turn
Collaboration Engine 5.1.0.alpha4
Handle Form Values and Field Highlighting with Your Own Logic
Collaboration Engine now includes FormManager to set property values and field highlighting in a form, and to react to changes in these. It provides a simple way to create a custom form component with collaborative features.
The manager can also be used in conjunction with a CollaborationBinder connected to the same topic. Any changes made to property values or highlighting via the FormManager will be reflected in any fields bound to the same properties, and vice versa.
FormManager manager = new FormManager(form, localUser, "my-topic");
manager.highlight("name", true);
manager.setHighlightHandler(context -> {
String propertyName = context.getPropertyName();
UserInfo user = context.getUser();
// Executed when a field is highlighted
return () -> {
// Executed when a field is no longer highlighted
};
});
manager.setValue("name", "John");
manager.setPropertyChangeHandler(event -> {
String propertyName = event.getPropertyName();
Object value = event.getValue();
// Executed when a property value is changed
});Other changes since 5.1.0.alpha3
- Breaking Changes:
- Use plain strings as backend payload.