0

Looking for client side details / documentation on how to access the Wakanda server side progressIndicator details from an Angular application.

I find the latest server side docs on progressIndicator, but nothing on how to access these from the client.

In the old days of WAF, the communication was handled via the widget. I'm rewriting clients and do not find any documentation on the client side.

Thanks

Kirk
  • 541
  • 1
  • 4
  • 10

1 Answers1

0

In V1, WAF offers a widget to periodically connecting to the server using the name of progress indicator as the reference.

In V2, the progressIndicator is available in REST API via rest/$info/ProgressInfo.

The call to {ServerIP}/rest/$info/ProgressInfo will return an array of current progress indicators on the server side. Each object represents an active progress indicator containing information like value, max, start time, etc.

Below is a quick example of calling rest/$info/ProgressInfo with the example code from Wakanda doc. The two calls are about 5 seconds apart: enter image description here enter image description here

Notice the fValue has been updated on the server. The developer can check for the updated value periodically and present it in customized progress bar, tag or progress bar from libraries like Angular Material.

Hope this helps.


Updated Requirements for $info:

When Wakanda server is in Controlled Admin Access Mode, $info is only available to users in Admin group, this requires the user log in and have an active session that belongs to admin group. This is documented in $info doc page.

The Controlled Admin Access Mode is not implemented in 4D Web server so $info will always work when sent directly to 4D. But this is highly not recommended because you will not be able to manage sessions and each REST call will consume a new client license.

In order to use progress indicator via $info in your Wakanda app, I would recommend considering disabling Controlled Admin Access Mode by implementing custom authentication using login listeners.Or, use getProgressIndicator() in RPC/Dataclass methods to implement a new REST access to display progress indicator to all users.

Xiang Liu
  • 393
  • 1
  • 7
  • By far this is an easier solution vs. the alternative of writing a WebSocket server and client interface. My question is, has or is the Wakanda team planning to publish this and other client implementation details to supplement the server side API documentation? – Kirk Apr 26 '18 at 01:33
  • Getting the following response across different browsers: {"__ERROR":[{"message":"You must log into the Admin group to obtain information regarding your project.","componentSignature":"dbmg","errCode":1611}]} – Kirk Apr 26 '18 at 03:28
  • Is it possible to call the /rest/$info/ProgressInfo api via the wakanda client in an angular application? Or do I have to use an authenticated http request using an ID/Pwd that has Admin privilege? This doesn't seem right. – Kirk Apr 26 '18 at 04:02
  • What version did you test with? My test was done in 2.5.0 Enterprise version in a new solution. There was no requirement for Admin privilege. – Xiang Liu Apr 27 '18 at 18:31
  • Xiang Liu - can you please try the following to reproduce the issue that I have also reproduced on 2.5.0. Create a new solution, add an Admin user and another user, create an Admin group and a Reporting group. Assign the non admin user to the Reporting group only. Then try to run your http://127.0.0.1:8081/rest/$info/ProgressInfo URL. Even if you pass in username:password in the URL, you'll get the result: {"__ERROR":[{"message":"You must log into the Admin group to obtain information regarding your project.","componentSignature":"dbmg","errCode":1611}]}. – Kirk May 01 '18 at 01:29
  • And as well, the question above also asked if the $info structure can be accessed via the latest Wakanda client (angular)? catalog, directory are documented. But not info. – Kirk May 01 '18 at 01:40
  • Note that using 4D if I pass http://username:password@127.0.0.1:8081/rest/$info/ProgressInfo in a GET or POST request, it succeeds. So then my confusion is now isolated to why I am unable to test this from the browser by typing in the above URL. Thanks for your patience. – Kirk May 01 '18 at 01:57
  • Also, attempted using http.get(url).subscribe(...) including the username/password in url, but it gets the same error message as experienced with the attempt from the browser. Would appreciate sample angular code. 4D is packaging the username/password in a form that works. Not sure how. – Kirk May 01 '18 at 03:23
  • Hi Kirk, Wakanda does prevent access to ret/$info when Admin user group is enabled. I have posted more details and suggestions in the main post. Hope it helps. – Xiang Liu May 02 '18 at 17:29