Portrait 7.0.0 - Reisalpe

Released: Aug 28, 2024

Reisalpe von S.jpg
Mount Reisalpe - Highest mountain in the Gutenstein alps (Photo: Herzi Pinki)

Get ready for the highly anticipated Reisalpe release! This iteration of Portrait, the critically acclaimed platform, takes innovation to the next level with powerful new features and mighty enhancements, empowering your enterprise like never before. Discover the future of enterprise apps today!

 

Before we start, we invite you to check all those features we shipped since our last major-release:

Obviously, Schöpfl was a feature-packed iteration and made digitalization for our customers a lot easier and intuitive. With the upbringing of Portrait 7.0 we hat-tip to “Schöpfl”: We thank you for your services and say goodbye to Portrait 6.0. May the retirement be a relaxing one!

 

Release “Reisalpe” will be the next summit ahead. With the initial release, not only did we work on bugs and security, but we immediately bring in new features.

In the spirit of our versioning scheme, minor-releases in the 7.x series will also bring new features a long the way. Remember: Major releases mainly indicate that breaking changes are occurring.

 

Highlights

 

Security improvements notice

At Treskon, we take application security seriously, which is why we continuously enhance the security features of our platform. We strive to strike a balance between automated configuration options and strict input validation, ensuring that our users can build flexible and dynamic web applications with confidence.

Please note that Portrait is designed to empower admins to create custom web applications. While we prioritize robust security, we also recognize the importance of flexibility and ease of use in our platform. As such, you may need to perform manual configuration or make informed decisions about trade-offs between security and functionality.

As an admin using Portrait to build your application, it's essential that you consider your own application's security needs and take responsibility for ensuring its security. With our latest update, we're introducing new configuration options that enable admins like you to further strengthen their application's security by adding custom input validation, permissions, conditions, and limiting form submissions to specific entries. These enhancements empower you to build applications that meet your unique needs while maintaining a high level of security.

Permissions

Sections can now be configured to be only accessible for admins.

- name: hr role: ADMIN caption: HR group: Management

role String

ADMIN = only admins can see this section

USER = every user can see this data

If you don’t define it, role USER will be applied

Admin only sections will now be displayed in the administration view:

image-20240827-153617.png

Section Actions

The Action inside a Section has been reworked and now support:

This will be useful, if you need to allow an action/form only if a certain criteria is met.

Example

Imagine, Portrait is used to manage the inventory of field-service-engineers. Portrait has an overview of each service-engineers personal inventory. Therefore, Portrait, lists the current stock of the inventory.

In case an inventory item is low, the service-engineer shall be able to file a restock form. So, only if the stock is sub 3 items, the form restockItemForm shall be shown to the user:

Config inside the section inventory:

sections: section: - name: inventory ... actions: - label: 'Order Restock' key: 'restockItemAction' type: 'FORM' condition: - expression: '{{lt Amount 3}}' value: 'restockItemForm' icon: 'shopping-bag'

 

This will show the button to open the form restockItemForm, because Amount is lower than 3:

Details, see: https://portrait.atlassian.net/wiki/spaces/PA7/pages/1030750209.

Forms

Forms and the underlying onSubmit implementation got a big update:

Permissions

Forms can now be configured to be only accessible for admins.

- id: createInventoryItem role: ADMIN onSubmit: type: ELO ... dialog: config/forms/createInventoryItem.json

role String

ADMIN = only admins can see this section

USER = every user can see this data

If you don’t define it, role USER will be applied

Field Processors

Field Processors support has been added to forms and is now also available for: Python, SQL. They work similar to the existing implementation of Field Processors for ELO:

  • For Python, the evaluated Field Processors are passed alongside the form fields to the python script via the --args flag.

  • For SQL, the evaluated Field Processors are available as variables for the SQL query.

Forms based on existing entries - Mode and Scope

It is now possible to link forms to existing entries. This allows Portrait administrators to further increase their application security and data consistency. To achieve this goal, we introduced multiple configuration options.

Update-Mode

With the new Mode Update you make the ‘previous’ entry-fields available as variables to be used for Field Processors, SQL queries or further processing in your Python script. In other words, the Create-Mode ignores existing entries - and therefore shouldn’t be used if you need conditions or security.

Do not confuse the Update-Mode with an SQL UPDATE Statement.

Overview of the currently supported modes:

Submit-Type

ELO

SQL

Python

BLP 5.1

Submit-Type

ELO

SQL

Python

BLP 5.1

Create-Mode

Update-Mode

Delete-Mode

Default

Create

Create

Create

Create

The Update-Mode also brings you the ability to compare the new form-input with the existing entry data inside the index. The original attributes are therefore prefixed with ORIGIN_ (STATUS → ORIGIN_STATUS). Comes in handy, if you want to use Conditions on form submit.

Strict-Scope (ELO only)

Furthermore the scope setting was introduced. This was necessary, since it was possible in Portrait 6.x to manipulate unrelated Sord’s in ELO with some “bad-actor-energy”. We won’t go into details here.

However, with Portrait 7.x things changed with the setting the scope to STRICT. This will prevent editing unrelated Sord's which are not indexed in Portrait.

Therefore, it is highly recommended to apply this configuration.

In the upcoming releases of Portrait, we may will enforce the scope to STRICT.
Act now, to avoid issues in the future.

Plausibility check

In addition a check is applied:

  • SQL and Python

    • If a form is submitted and no corresponding entry is found in the Portrait index, the operation is cancelled.

  • ELO

    • If a form is submitted and no corresponding entry is found in the Portrait index AND the scope is set the STRICT, the operation is cancelled

Summary

Still unsure, what to do? We got your back:

If you have forms, that submit data to ELO, add the mode property to the onSubmit settings and set it accordingly. It will be either: CREATE, UPDATE or DELETE. Also set the scope property to STRICT.

If you have forms, that submit data to SQL or Python, add the mode property to the onSubmit settings and set it accordingly. It will be either: CREATE or UPDATE.

Please read our docs on the given use-case, wholeheartedly:

 

This examples shall round it up:

Example 1: ELO - Update an entry

You have a form in Portrait, that should edit an indexed entry in Portrait and ELO. The config:

Example 2: ELO - Delete an entry

You have a form in Portrait, that should delete an indexed entry in Portrait and ELO. The config:

Example 3: Python - Update an entry

You have a form in Portrait, that should edit an indexed entry in Portrait and run a py-script. The config:

Example 4: SQL - Update an entry

You have a form in Portrait, that should edit an indexed entry in Portrait and SQL. The config:

Example 5: BLP5.1 - Trigger a process

You have a form in Portrait, that should start a process in BLP5.1. The config:

Conditions

With Portrait 7.0 we introduce the concept of conditions, which allows for extensive input validation to keep your data consistent at all times.

Furthermore, you can define which user can use which operation. Like this you can enforce “ACL” / permissions and define, which user is allowed to edit or delete an entry. I´

A condition is a boolean expression when evaluated either allow or prevent:

Example

Multiple conditions can be set. All conditions need to match. (Logical AND between all conditions). You can build more complex rules with nested handlebars.

If needed, variables can also be preprocessed with https://portrait.atlassian.net/wiki/spaces/PA7/pages/1029114243, this allows a better readability.

Conditional support on forms https://portrait.atlassian.net/wiki/x/SQNXPQ currently works for: ELO, Python and SQL.

For more details, see: https://portrait.atlassian.net/wiki/x/AYDHPg

Field processors

Field processors are a powerful tool to manipulate and evaluate data. Field processors are integrated in several areas of Portrait. Use them inside Sources to add or modify a field while reindexing data, use them within a form submit to validate the posted data, add them to actions to have conditional visibility of actions.

In this release we added new functionality to the field processors.

Boolean

A new type boolean has been added.

Example

Details, see: https://portrait.atlassian.net/wiki/spaces/PA7/pages/1029114243

In Helper

Check if a given value is contained in a given list of other values:

Also a combination with various split methods is possible:

Details, see: https://portrait.atlassian.net/wiki/spaces/PA7/pages/1029114243/Field+Processors#In

File download

It is now possible to download files linked to an indexed ELO entry directly from the table or detail view.

Example

Will be displayed like this:

Depending on the file type, a preview is available. All files are available to download.

Details, see: https://portrait.atlassian.net/wiki/spaces/PA7/pages/1029114146/ELO+sources#Index-Documents%2FFiles

References

A new nifty feature is to reference between entries (across different sections) in Portrait.

Example

Imagine, Portrait is used to manage the incidents for service-engineers. Each service-engineer has a list of incidents. However each incident relates to a facility. Therefore it is useful to link from the incident to the facility, to see all documents, manuals and other details of the facility itself.

To achieve this, you need the new column type reference. The Config inside the section “incidents” looks like this:

The value of ServiceFacilityNo is 5001 (per example above) and this must also be the unique identifier for the entry in the facility source.

You can check this, by having a look at the URL of the target entry: https://service.customer.com/facilities-at/5001/

Details, see: https://portrait.atlassian.net/wiki/spaces/PA7/pages/1029113865/Column+Types#Reference

Search index space optimization

We optimized the required disk space for the search recommendations. To take full advantage of this, we recommend that you delete your index and rebuild them from scratch.

To do this:

  1. Delete your sources that you want to optimize in the admin dashboard.

  2. Restart Portrait

  3. If mandatory, trigger a manual reindex if not configured periodic reindexing.

Breaking changes

Breaking changes led to a major release. In this chapter, we summarize the breaking changes - which might affect your installation and need to be considered, whilst upgrading.

SQL form submit parameter

We increased the security measurements whilst dealing with SQL write operations. This means, the SQL query will be parsed as prepared statement. For safety reasons, we enforce this style now for every SQL query. These changed are valid for all DML Statements. DDL Statements are not supported anymore.

Example

Given this example for the createNewCompany form:

Old - 6.x

New - 7.x

In this given example, the form-data will be inserted into the table DemoOrganigram via the connection organigram.

The FieldProcessors can either be used to format fields or as a fallback in case of an optional field in the form. If not supplied the Query would fail as there would be no valid parameter :Name if not set previously. With the given FieldProcessor the fallback is an empty string.

Details, see: https://portrait.atlassian.net/wiki/x/pQNXPQ

ELO sources files indexing

When indexing files to the public folder, it is now required to set publicCache: true.

Example

Details, see: https://portrait.atlassian.net/wiki/spaces/PA7/pages/1029114146/ELO+sources#Index-Documents%2FFiles

Indexed files are also displayed in the section view and are available as a download.
Optionally, this behaviour can be disabled by setting the following flag inside the section:

Details, see: https://portrait.atlassian.net/wiki/spaces/PA7/pages/1029113898

ELO sources Adminbase and Chaosablage indexing

When indexing elements within the ELO Administration (aka. “Administration” folder) and “Chaosablage”, results are per default now ignored this can be changed with:

In addition you can also provide own folder GUIDs that will be excluded.

Details, see: ELO sources

ELO source-ID's

With this version, we switch to a more classic approach, like how ELO uses GUID’s. In ELO the identifier for a SORD is either a Object-Id, or a GUID. We use the GUID of ELO, but previously we removed the surrounding brackets artificially. With Release 7.X we remove this artificially modification of the GUID:

ELO Unique Identifier

Old - 6.x

New - 7.x

ELO Unique Identifier

Old - 6.x

New - 7.x

GUID

FC4B5EB2-359A-2FAE-C3DE-AC908A1A6BD9

(FC4B5EB2-359A-2FAE-C3DE-AC908A1A6BD9)

 

 

There might be some changes required in your configuration, if you used https://portrait.atlassian.net/wiki/spaces/PA7/pages/1029114243, that use or manipulate the ELO-GUID’s.

Examples

Field Processor Use-Case

Old - 6.x

New - 7.x

Field Processor Use-Case

Old - 6.x

New - 7.x

A link to another Portrait detail entry. With 6.x you needed a substring manipulation.

value: '{{#if PARENT_ELOGUID}}[Open](https://organigram.customer.com/complete/{{substring PARENT_ELOGUID 1 37 }}/hi){{/if}}'

value: '{{#if PARENT_ELOGUID}}[Open](https://organigram.customer.com/complete/{{PARENT_ELOGUID}}/hi){{/if}}'

A link to the ELO Rich Client (via ELO protocol handler). In 6.x you had to add ( ) to the link.

value: 'elodms://({{key}})'

value: 'elodms://{{key}}'

When building references for the organigram inside Portrait, you had to remove the ( ).

value: '{{substring SHARE_SUBSIDIARY_ELOGUID 1 37 }}'

value: '{{SHARE_SUBSIDIARY_ELOGUID}}'

This examples prove, that with the new unaltered approach, the configuration gets simpler.

API changes

We did our homework, and the API, especially the documentation for it, is now concise and this will increase the possibilites to better integrate Portrait in your automations. If you open the API docs you will find a clean and grouped doc now.

We also changed the following API routes, for better clarity:

API Use-Case

Old - 6.x

New - 7.x

API Use-Case

Old - 6.x

New - 7.x

Get all entries for a specific section or the global search

/data/

/search/

Get all entries for specific section or the global search with filter term (search query)

/data/{term}

/search/{term}

Retrieve the key value pairs for a single entry - nonetheless, what section it is in.

/docDetails/{docId}
(where docID was similar to the entryID)

This would lead to an issue when there would be the same entryID in two different sections. To guarantee uniqueness, docDetails was removed

Use either /entries/{sectionID}/{entryID} to query an unique entry. Or/data/{term} to perform a global search.

Method to retrieve a certain entry - via the source.

sources/{index}/{entryID}

This is similar to/entries/{sectionID}/{entryID}

Use /entries/{sectionID}/{entryID}