the description of the service locks
Description
Service locks (NewPlatform.Flexberry.LockService) is designed for convenient implement locking mechanism. For example, you want to protect certain data object from changes by other users at the time how it is edited by any user.
In versions Flexberry Designer 2017.06.14-beta08 and subsequent LockService connects automatically.
Add service locks for earlier versions
- To include in Ember Flexberry project LockService, adding
environment.js
:
// Settings lock.
lock: {
enabled: true,
openReadOnly: true,
unlockObject: true,
}
Where:
- enabled - enable/disable LockService.
- openReadOnly - responsible for opening edit form read-only, if the form is locked.
- unlockObject is responsible for deleting the lock when exiting the form.
-
Add Backend ODataService library NewPlatform.Flexberry.LockService.
- Add to ODataConfig assemblies type Lock:
namespace NewPlatform.Flexberry.Services { ... var assemblies = new[] { ... typeof(NewPlatform.Flexberry.Services.Lock).Assembly }; ... };
- Retrieve current user for a lock now carried out via the method
getCurrentUserName
serviceuser
(defined in the addonember-flexberry-data
). By default, this method will return the user nameuserName
. At the application level, you must override this method if you are using authentication in your app or if you want to return a different user name in case no authentication mechanism in the application.