Article
· Nov 15 2m read

Java Global Editor

This is the related article to the package in Java Contest. 

I decided to present a CRUD++ Global Editor based on IRIS Native API for Java.
++ because it’s a little bit more than just Create, Read, Update, Delete
Visualization of a global is always important to review results immediately.

  • For this purpose, I have extended the API with a Tree Viewer that mimics  ZWrite and allows also the examination of subtrees.
  • A $Query Style Navigator Forward and Reverse operating for easy finding the Global node of interest.
  • Finally, an option to ZKill to delete the content of a Global Node without deleting the subtree below was added.

This required a small helper class on the server side as an extension to the default API

My strategy was to have a rather modest interface usable from the command line
as on Docker console or terminal and keep it as simple as possible. 
Fancy graphic interfaces just distract from the essential content of the example.

If there is any default or a previous value is displayed at input prompt.

In Docker container, the editor is already ready for use.

  • docker-compose exec iris java gedi

 You first connect to server 

        Welcome to IRIS NativeAPI Global Editor

>>> serverIP [127.0.0.1]:
>>> serverPORT [1972]:
>>> namespace [USER]:
>>> username [_SYSTEM]:
>>> password [SYS]:

        Connected to Namespace USER on Server 127.0.0.1:1972

 

Then you loop in the editor menue

 0 = Select Global
 1 = Select Subscripts
 2 = Query Forward
 3 = Query Reverse
 4 = Show Global Tree
 5 = Update Global Value
 6 = Delete Global Value
 7 = Delete Global Tree
 * = Exit Demo

Select the Global and the Subscript you want to work on . 
Especially Global name and Node Subscripts are kept for simple navigation.

0 Selecting the Global clears all Subscripts 

It can be a fresh nonexistent Global too 

1 The subscript you select is kept until you step to menu 0.

2 Move to the Next node with data.

 

The actual Subscript is updated by the new node

Moving beyond the last node clears Subscripts

3 Move to the Previous Node with data.

moving Reverse from the top node shows the last node

4 The Global tree is shown with the actualSubscript on top

The starting node doesn't need data to be accepted

5 Update or set a value to the Node.

or Update

6 This acts like ZKILL removing data but keeping the subnodes.

7 This is the default KILL destroying data and subnodes.

 * Leaving the editor.

I hope you enjoy it and vote for my demo in the contest.

GitHub

Video

Discussion (2)1
Log in or sign up to continue

Hi Robert,

Your video is available on InterSystems Developers YouTube:

⏯️ Java Global Editor

https://www.youtube.com/embed/eUVsxYVKw8Q?si=sZ_ApCFaQMJ19oPn
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

Please enjoy!