4D 20 R8 is now available and offers a new set of 4D Qodly Pro features to empower your web applications.
Keep discovering this powerful platform—a robust, user-friendly solution for building business web applications with minimal coding effort.
Integrated within 4D, 4D Qodly Pro for 4D allows you to leverage existing business logic developed for desktop applications.
It is time now, with 4D 20 R8, to discover how to implement HTTP request handlers, work efficiently with roles and privileges, and gain perfection with dynamic UIs.
HTTP handlers
You might have already read this blog post about HTTP handlers.
With the introduction of HTTP Request Handlers on the 4D HTTP Server, you can accurately define which business logic you want to trigger regarding specific URL patterns.
Regarding 4D Qodly Pro, the main advantages of this feature are:
- Allowing a redirection on a Qodly page which opens up new perspectives to extend 4D applications on the web
- Set up a navigation action on a URL covered by the HTTP Request Handlers so that you can implement the related business logic (for example, to provide some download file/upload file features).
This feature is coupled with the 4D.OutgoingMessage class for a smooth user experience.
This blog post contains all the implementation details and a concrete 4D Qodly Pro example in the HDI.
To ease the use of HTTP Request Handlers in 4D Qodly Pro, you can set up them in a user-friendly interface. To do this, open the HTTP Handlers section in Explorer.
Want this kind of feature?
Check the doc to learn more about HTTP Handlers and how to start setting them up!
roles and privileges
Have an accurate view of allowed actions for each role
You might already have set up roles and privileges to protect your data against malicious access.
Reminder:
Privileges can be used to control who can perform operations such as create, delete, read, execute, etc., in your application.
You can define roles to aggregate several privileges so that roles fit with your users’ roles in your application. When your user logs in, use Session.setPrivilege(role) function to grant this user with the corresponding set of privileges
Thus, it is convenient to have a global overview of all actions allowed for a given role (i.e., an end user) and the involved data.
Use the new Roles page to instantly review your role permissions resolved against your datastore resources based on the set of privileges you defined. This is useful for security reviews and audits!
view and clean up privileges involving unexisting resources
While developing your app, it is pretty sure you’ll change the name of some dataclasses, attributes, or functions and delete some of them.
The privileges involving those resources will be ineffective. It is important to keep the roles and privileges up to date.
Now, privileges involving unexisting resources have a special rendering to draw your attention.
You can also clean all of them thanks to the Clear button.
Handle states for authenticated / unauthenticated users
The condition editor has been enhanced when privileges are involved.
If you handle an authentication, the session is associated with some privileges during this authentication phase thanks to the Session.setPrivileges() function.
Thus, when the user is authenticated, the session contains the privileges associated with the user’s role (see the above section on Having an accurate view of allowed actions for each role).
When the user is not authenticated, the session contains only the guest privilege.
While handling states in 4D Qodly Pro, you can enable states for authenticated and non-authenticated users.
For this, choose the Privilege type for the condition and use the has at least one privilege or has no privilege operators.
has at least one privilege means the session contains other privileges than the guest one (authenticated user)
has no privilege means the session contains only the guest privilege (not authenticated user)
You can then handle such a dynamic UI:
sort a large amount of data in a datatable
In a datatable, you can select an element and later sort the data by clicking on a column header. But what comes out of your selected element?
Two options are now available after the sort action:
– scroll to the top of the datatable (and keep the selected element)
– keep the focus on the selected element
the three state check box
A check box must be bound to a Boolean datasource. This datasource can be True or False, but it can also be Null (for example, a boolean attribute is Null in a newly created entity).
If this Null value is relevant to your business, you can now reflect this value in a three-state check box.
Show/hide tooltip for text input password
Offering the end user the possibility to hide or show a password while entering it is an essential web feature. Thanks to the new Reveal password property, you can now do that.
Note that you can also choose the icon’s placement (right or left).
cONCLUSION
Don’t wait any longer to try those new 4D Qodly Pro features and make your web app user-friendly and powerful!