Template Examples - Locker

From Documentation
DocumentationSmall Talks2018JanuaryTemplate Examples - Locker
Template Examples - Locker

Author
Robert Wenzel, Engineer, Potix Corporation
Date
January XX, 2018
Version
ZK 8.5

Introduction

What we want

Avoid multiple users from editing the same resource simultaneously.

  1. lock / unlock a resource
    e.g. obtain and release exclusive access to edit a specific objects properties
  2. observe a resource for owner changes (LockEvents)
    it should be possible to observe the same resource with multiple concurrent users
  3. react to LockEvents and update the UI
    immediately indicate availability/ownership/unavailability of a resource to the user

How it works

Summary

Example Sources

The code examples are available on github in the zk-template-examples repository

zul files: https://github.com/zkoss-demo/zk-template-examples/tree/master/src/main/webapp/locker
java classes: https://github.com/zkoss-demo/zk-template-examples/tree/master/src/main/java/zk/example/template/locker

Running the Example

Clone the repo

   git clone git@github.com:zkoss-demo/zk-template-examples.git

The example war file can be built using the gradle-wrapper (on windows simply omit the prefix './'):

   ./gradlew war

Execute using gretty:

   ./gradlew appRun

Execute using jetty-runner (faster startup):

   ./gradlew startJettyRunner

Then access the example http://localhost:8080/zk-template-examples/locker/


Comments



Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.