Skip to content

Commit

Permalink
Merge branch '2024.3' into '2025.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 15, 2024
2 parents 0364fd2 + 794986e commit 7538322
Show file tree
Hide file tree
Showing 10 changed files with 156 additions and 10 deletions.
1 change: 1 addition & 0 deletions modules/applications/applications-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
**** xref:how-to-share-data-across-pages.adoc[How to share data across pages]
**** xref:how-to-control-visibility-of-widgets.adoc[How to control visibility of your widgets]
**** xref:how-to-handle-pagination.adoc[How to handle server-side pagination]
**** xref:how-to-create-editable-tables.adoc[How to create editable and powerful Tables]
*** xref:resources.adoc[Resources]
*** xref:faq.adoc[FAQ]
** xref:uid-applications-index.adoc[Living applications with Bonita UID]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
136 changes: 136 additions & 0 deletions modules/applications/pages/how-to-create-editable-tables.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
= How to create editable and powerful Tables
:description: Learn how to configure tables from which you can edit Bonita data, display dynamic values, and many other things.

{description}

* Difficulty: beginner
* Estimated time: 20 minutes
* Prerequisites: have a Table widget bound to the following API request which lists users:
** `Name`: getUser
** `Method`: GET
** `URL`: /bonita/API/identity/user
** `Params`:
- `Key`: c
- `Value`: 20
- `Key`: p
- `Value`: 0
This Table widget and its data will be used as example in this guide.


== Create columns with dynamic values

As you might be using Bonita UI Builder to create applications that answer complex business needs, you will probably want to add new columns with dynamic values.

=== Via JavaScript objects
Let’s say you want to add a column whose values are a multiplication of two other columns.

First, go to the `JS` tab (between the `Queries` and `UI` tabs), create a new JS object called *Calculation* and copy paste the following code:

[source, JS]
----
export default {
calculate: (num1, num2) => {
var calculation = num1*num2;
return calculation;
}
}
----

Click the Table widget (which displays the list of Bonita users). Then click `add new column`, click the wheel icon to customize it and copy paste the following code in the `Computed value` zone: `{{Calculation.calculate(currentRow.manager_id,currentRow.id)}}`

image::images/guides/multiplication.gif[multiplication]

=== Without JavaScript objects

You don’t always need JS objects to create dynamic columns. Let’s say you want to create a *Gender* column whose value depends on whether the title is *Mrs* or *Mr*.

In a similar way to what was done in the previous example, create a *Gender* column, click the wheel icon, and copy-paste the following code:
`{{currentRow.title === "Mr" ? "male" : "female"}}`



== How to dynamically configure cells' color

You might also want your Table’s cells to have different background colors, defined according specific conditions.

Let’s say you want to color cells depending on the user’s title.
Click the wheel icon next to the `title` column, go to the `Style` tab, click the `JS` icon next to _Cell background_ and add the following code:
`{{currentRow.title === "Mrs" ? "#fce7f3" : "#dbeafe"}}`


image::images/guides/background_color.gif[background_color]


You can also trigger conditions on numbers, for example if the user’s id is superior or equal to 35: `{{currentRow.id >= 35 ? "#fce7f3" : "#dbeafe"}}`



== Create an editable table that can interact with your Bonita data

Editing your data directly from a Table has just become easy with Bonita UI Builder.

Let’s create a table from which we can edit a user's firstname, and propagate these changes to your actual Bonita users.

=== 1. Create an update request

Go to the `Queries` tab and create the following query:

* `Name`: updateUser
* `Method`: PUT
* `URL`: /bonita/API/identity/user/{{Table1.triggeredRow.id}}
* `Params`:
- `Key`: c
- `Value`: 20
- `Key`: p
- `Value`: 0
* `Body`:
[source, JSON]
----
{
"firstname": {{Table1.triggeredRow.firstname}}
}
----

This request updates the user’s firstname with the Table’s cell content.


=== 2. Allow the Table to edit users

Select the Table widget and click the box next to `firstname` to make it editable:

image::images/guides/tick_editable.png[tick_editable]


A `Save / Discard` column then appears. Click the wheel icon next to “Save / Discard” to customize it.

Then, click the `+` icon next to `onSave`, select _Execute a query_ and select _updateUser_.

image::images/guides/onsave_table.gif[onsave_table]


The Table can now update the user's fistname after clicking `Save`.

[TIP]
You can also make the `firstname` column editable under conditions.
Click the wheel icon next to `firstname`, then click the `JS` icon next to *Editable* and copy paste the following code:
`{{currentRow.title === "Mrs" ? true : false}}`.
This makes it editable only if the user is a _Mrs_.

=== 3. Automatically refresh the table after saving

After clicking the Save button, let’s automatically refresh the table (via a call to `getUser`) and display a success message.

To do so, click the `On success` button and add the following actions:

image::images/guides/refresh_table.png[refresh_table]


== Make a component visible under conditions

Your applications can quickly get complex and dense. In this situation, widgets' visibility can be controlled in many ways.

Let’s say we want to display a form whenever `last_connection` cells are empty.

To do so, drag and drop a form widget, click the `JS` button next to `Visible` and copy paste the following code:
`{{Table1.selectedRow.last_connection === "" ? true : false}}`
21 changes: 13 additions & 8 deletions modules/identity/pages/single-sign-on-with-cas.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ The method https://docs.oracle.com/javaee/7/api/javax/servlet/http/HttpServletRe

If you need more fine tuning or if you cannot update the reverse proxy configuration, you can consult the official documentation for https://tomcat.apache.org/connectors-doc/common_howto/proxy.html[Tomcat].


== Configure Bonita Engine and Tomcat for CAS

. The CAS implementation relies on JAAS, and is defined in the BonitaAuthentication module of the JAAS configuration file. +
The CAS implementation relies on JAAS, and is defined in the BonitaAuthentication module of the JAAS configuration file. +
Set the Java system property `java.security.auth.login.config` in the Tomcat startup script to point to the JAAS configuration file, xref:runtime:bonita-platform-setup.adoc[`BUNDLE_HOME/server/conf/jaas-standard.cfg`].
+

For example, on Linux, edit `BUNDLE_HOME/setup/tomcat-templates/setenv.sh`, uncomment the line that defines `SECURITY_OPTS`, and insert the variable `SECURITY_OPTS` in the line `CATALINA_OPTS=..`.
+
The `BUNDLE_HOME/server/conf/jaas-standard.cfg` file contains the following (replace `ip_address:port` with the relevant IP addresses and port numbers, in two places):
+

The `BUNDLE_HOME/server/conf/jaas-standard.cfg` file contains the following (replace `ip_address:port` with the relevant IP addresses and port numbers, in two places): +

[source,conf]
----
Expand Down Expand Up @@ -91,6 +91,7 @@ If the platform has already been initialized, every update to the configuration
* `setup pull`
* edit configuration file(s)
* `setup push`
* restart your server to apply the changes
====
+
.. You must perform the following changes:
Expand All @@ -111,16 +112,17 @@ Specify the relevant IP address and port number.
[discrete]
==== Configure the Bonita Runtime for CAS SSO

. For each tenant, edit `authenticationManager-config.properties` to enable the CASRemoteAuthenticationManager and its properties.
For your active tenant, edit `authenticationManager-config.properties` to enable the CASRemoteAuthenticationManager and its properties.
Edit the `authenticationManager-config.properties` located in `platform_conf/initial/tenant_template_portal` for not initialized platform or `platform_conf/current/tenant_template_portal` and `platform_conf/current/tenants/[TENANT_ID]/tenant_portal/`.

[NOTE]
====
If the platform has already been initialized, every update to the configuration files under `setup/platform_conf/current` must be done using the `setup` tool:
* `setup pull`
* edit configuration file(s)
* `setup push`
* edit configuration file(s)
* `setup push`
* restart your server to apply the changes
====

Make sure that `auth.AuthenticationManager` property is set to `org.bonitasoft.console.common.server.auth.impl.jaas.cas.CASRemoteAuthenticationManagerImpl`
Expand All @@ -140,6 +142,8 @@ Cas.bonitaServiceURL = http://ip_address:port/bonita/apps/appDirectoryBonita
logout.link.hidden=true
----

Restart your server to apply the changes.

[discrete]
==== CAS SSO and Java client application

Expand Down Expand Up @@ -173,6 +177,7 @@ If the platform has already been initialized, every update to the configuration
* `setup pull`
* edit configuration file(s)
* `setup push`
* restart your server to apply the changes
====

If this option is set, when users navigate away from the Bonita Applications, they are still logged in to CAS.
Expand Down
4 changes: 3 additions & 1 deletion modules/identity/pages/single-sign-on-with-kerberos.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Trust this user for delegation to any service (Kerberos only).

== Configure Bonita Bundle for Kerberos

You need to execute the following actions in the folder of each tenant for which you want to support authentication over Kerberos.
You need to execute the following actions in the folder of each tenant for which you want to support authentication over Kerberos. Files are located in `<BUNDLE_HOME>/setup/platform_conf/current/tenants/<TENANT_ID>`. +
If you want this configuration to also apply to each tenant created later, make sure to also perform those actions in the _template_ tenant configuration folder:
`<BUNDLE_HOME>/setup/platform_conf/current/tenant_template_*` (if you have not started the Bonita bundle yet, the files are located in `<BUNDLE_HOME>/setup/platform_conf/initial/tenant_template_*`)

Expand Down Expand Up @@ -289,6 +289,8 @@ If you want Bonita engine to create the accounts on the fly when a user accessin
+
NOTE: Activating this option means any user logged in on the domain trying to access Bonita will have an account created automatically in Bonita Database.

. Restart your server to apply the changes. +

. Confirm that your Domain Controller is correctly configured. +
Then you can start the bundle and try to access any Bonita Application page, an app page or a form URL (or just `http ://<host>:<port>/bonita[?tenant=<tenantId>]`) and make sure that you are automatically logged in.

Expand Down
4 changes: 3 additions & 1 deletion modules/identity/pages/single-sign-on-with-saml.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Bonita "username" should match the NameId or one of the attributes returned by t

== Configure Bonita Bundle for SAML

You need to execute the following actions in the folder of each tenant for which you want to support authentication over SAML.
You need to execute the following actions in the folder of each tenant for which you want to support authentication over SAML. Files are located in `<BUNDLE_HOME>/setup/platform_conf/current/tenants/<TENANT_ID>`. +
If you want this configuration to also apply to each tenant created later, make sure to also perform those actions in the _template_ tenant configuration folder:
`<BUNDLE_HOME>/setup/platform_conf/current/tenant_template_*` (if you have not started the Bonita bundle yet, the files are located in `<BUNDLE_HOME>/setup/platform_conf/initial/tenant_template_*`)

Expand Down Expand Up @@ -198,6 +198,8 @@ The policy can either be FROM_NAME_ID or FROM_ATTRIBUTE (in that case you need t
** If you want to use the SAML logout feature, the URL of your Bonita server needs to be defined by replacing the following string (otherwise, you can remove this attribute):
*** http://bonita.server.url.to.change

. restart your server to apply the changes


[NOTE]
====
Expand Down

0 comments on commit 7538322

Please sign in to comment.