Skyve 8.3.0 released

Skyve 8.3.0 is a significant release which upgrades the version of PrimeFaces used by Skyve from 8 to 12, introduces a new behavioural metadata declaration to Skyve. It also includes more built-in and custom fomatters for tables and expressions, a new customisations interface, as well as several security library uplifts.

PrimeFaces 12

The responsive renderer used in Skyve (PrimeFaces) version was upgraded from 8 to 12. This has some minor look and feel changes, and theme version upgrades to the free Editorial theme, as well as the premium (paid) Ultima and Ecuador themes. Projects running Editorial will automatically update, but projects running Ultima or Ecuador will need to be manually updated. See the Notes for Upgrading section below for more details.

As part of this change, the icon library (FontAwesome) version was also updated from 4 to 6. Icons for use within applications can now be selected from the free set of icons available at FontAwesome. This increases the number of icons availale from 675 to 2025.

Behaviours

We have introduced behavioural metadata declarations into Skyve in an effort to reduce code. The goal is to encapsulate the most used use cases found in our client project code bases to allow for declarative behaviour.

We have only implemented the very beginning of this, including the if/then/else construct and set (set a value to an expression) methods. These behavioural implementations will all utilise Skyve expressions and Skyve bindings.

The behavioural blocks can be called directly from Java by either instantiating a behaviour Java class and executing it, or by calling upon Skyve metadata directly (e.g. instantiate an action and execute it). They will be available to be plumbed into the Skyve action/event/bizlet callbacks.

Currently, only actions are fully implemented, but a Bizlet metadata definition is coming. In the future, we plan to analyse our application project code bases and extract repeated code blocks to abstract/encapsulate these into behaviour declarations. This will reduce coding and unit testing burdens.

Behaviours are mainly interpreted, but there is an opportunity to forward engineer (code generate) behaviours into Java or other languages (e.g. dart). This is analogous to the "materialisation" of a dynamic domain to a static one, or the interpret/generate proposition of skyve-flutter.

The extended Skyve Bizlet class is no longer provides no default behaviour. It now executes any defined meta-data Bizlet for a document in the lifecycle. This allows a developer to choose when the declared metadata behaviour is called (by calling super) and allows embellishing this behaviour around (before or after) the declared behaviour, or even replacing the behaviour by never calling super at all. As before, Bizlet callbacks are polymorphic (based on the bean's runtime type) but do not call Bizlets up the document type hierarchy. This is something for the app developer to control as required.

With these changes, it is now possible to create actions/bizlets to perform simple behaviours that can be built from pre-defined statements (the encapsulation of behaviours). For example, toggling the state on click of a button, resetting a tab state on tab change, or changing the visibility of widgets. There are more context-aware statements to come through metadata schema (xsd) design, which will further simplify the process.

For an example of what this means in practice, an example behaviour has been added in the admin module. After upgrading or creating a new project running 8.3.0, you can refer to the modules.admin.Communication.actions.BatchSelected.xml action definition, which is now declared in metadata instead of Java. This action is called when the user selects a batch in the Communication view. The action is defined as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action name="BatchSelected"
        xmlns="http://www.skyve.org/xml/behaviour" 
        xsi:schemaLocation="http://www.skyve.org/xml/behaviour ../../../../schemas/behaviour.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <set binding="refreshBatches" expression="{el:false}" />
</action>

Customisations Interface

Skyve 8.3.0 introduces a new Customisations interface which allows you to customise the default text alignment and default column width in UIs, register expressions and formatters and default list grid export formats.

This can be used by implementing Customisations directly and providing all customisations, or extending NoCustomisations which provides the default Skyve behaviour.

For example:

import org.skyve.impl.metadata.controller.NoCustomisations;

public class AlignmentCustomiser extends NoCustomisations {

    @Override
    public HorizontalAlignment determineDefaultTextAlignment(String uxui, AttributeType attributeType) {
        // change the text alignment of all widgets to left, regardless of attribute type
        return HorizontalAlignment.left;
    }
}

The customisations class to use for your application can be specified in the skyve.json file, e.g. for the above class:

// Factory settings
“factories”: {
    // Skyve number generator class
    “numberGeneratorClass”: null,
    // Skyve customisations class
    “customisationsClass”: "org.demo.HorizontalAlignment"
}

Formatters

Skyve 8.3.0 introduces the ability to format the output of expressions and list grid columns using formatters. Custom formatters can be registered by name and can be used in expressions and list grid columns.

DataGrid boundColumn now defines two new attributes, formatterName, which uses an expanded set of built-in formaters, and customFormatterName. Columns defined in module queries can also make use of these two new attributes.

<dataGrid binding="results" inline="true">
    <boundColumn binding="resultValue" formatter="TenOptionalDecimalPlaces"/>
<query documentName="Invoice">
    <description>All Invoices</description>
    <columns>
        <column binding="invoiceTotal" customFormatter="MyCustomCurrencyFormatter">

Anywhere an expression can be defined, such as a blurb or within your application logic, can now specify a formatter to be used to format the result of the expression using the format {<prefix>:<expression>|<format>}; For example:

Binder.formatMessage("{bean : decimal10 | FiveOptionalDecimalPlaces }", bean);

The Customisations Interface allows registering of new formatters by name via the registerCustomFormatters() methods.

Admin

  • Add the ability to restrict Freemarker database reports to a specific role.
  • Show backup file size in the data maintenance backup list.
  • Add validation for the Startup backupDirectoryName to meet rules for valid cloud storage container names.
  • Handle Google Chrome >= version 115 deprecation of the document.domain setter which caused login issues in Chrome.

Desktop Render

  • Keep content images aspect ratio and fit content border.
  • ListView Snapshot and export naming changes.
  • Add Converter.getFormatPattern() for list grid export to Excel.
  • Secure list grid export and produce numeric and temporal values for spreadsheets and numeric values for CSVs.

Responsive Renderer

  • Fix zoom in button dimensions bug.
  • Fix remove bug after zoom in widget.
  • Ensure router finds correct xhtml when zoomed in.
  • Default to previously selected tab when selectedTabIndexBinding is null.
  • Implement change event handling on listMembership widget.
  • Revert the responsive gutter centred layout in ViewGenerator.
  • Dehydrate the faces bean after it is used in Bizlet.postRender().
  • Fix FluentFocusableInputWidget.addBlurAction().
  • Add tab scripts as children at the end of the resulting faces view.
  • Upgrade to PrimeFaces 12.
  • Upgrade to ecuador/ultima 6.1.0.
  • Use correct owningModule when traversing a relation in validateWithoutPrefixOrSuffix() so that the method doesn't force a module xml document import.

Framework

  • Add Skyve formatters formatting capability Data/List Grid/Repeater.
  • Add Customisations interface for default text alignment and default column width in UIs, for registering expressions and formatters and default list grid export formats.
  • Fix autocomplete for polymorphic bindings.
  • Add stack trace printing to health servlet when its in error.
  • Fix concurrency issue with generated Enums toDomainValues() method.
  • Synchronise interceptor and observer creation.
  • Add customer parameters to Observer interface methods.
  • Expose Binder.isSkyveExpression() and Binder.containsSkyveExporessions().
  • Add Skyve Behaviour.
  • Add ExpressionEvaluator.validateBinding methods.
  • Collect garbage and content check for dynamic domain content.
  • Add rollback (by default) to cancelled jobs.
  • Use context classloader everywhere in Skyve.
  • Redo Azure backup class and backup problem emailing.
  • All dynamic retrieval to return no rows in the case where a static bean is being populated with dynamic attributes.
  • Add singular access to ReportTemplate for AppUser role.
  • Security upgrade jasperreports to 6.20.5, poi to 5.2.3 and flying-saucer to 9.1.22.
  • Security upgrade of skyve-content to Tika 2.8.0 and Lucene 9.7.0.
  • Update TestUtil to cater for maximum text lengths when generating test data to pass regular expression validators.
  • Add flutter generation maven target.
  • Add Skyve formatters.
  • Add formatter suffix to Skyve expression evaluation and validation.
  • Add database index to admin.DynamicRelation.relatedId.
  • Uplift spring security to 5.3.29 in response to CVE-2023-34034.
  • Fix access processing for edit views on imported module documents for menu items and home documents.
  • Added project classpath configuration to the skyve-maven jasper compiler plugin.
  • Added Decimal10TwoDecimalPlaces converter.
  • Uprev maven in response to CVE-2021-26291.
  • Trap class cast exceptions in BeanVisitor and give a hint that the extension class has probably broken the bean bridge pattern.
  • Add Observer.preRestore() and Observer.postRestore().
  • Add style, styleClass, childStyle and childStyleClass attributes to <s:view />.

Notes for Upgrading

To upgrade your Skyve project to this version, change the Skyve version in your pom.xml to 8.3.0 and perform an assemble.

If you are upgrading from a version older than 8.2.4, please see the previous release notes and also apply those changes.

The skyve-content zip contains new libraries versions upgraded by the security uplift. After assembling, replace your existing skyve-content-x.x.x.zip in your project with the new skyve-content-8.3.0.zip.

As part of the PrimeFaces version change, any premium themes installed in your Skyve application will need to be upgraded to the latest version.

For example, to upgrade a project using the Ecuador theme:

  1. Login to the PrimeTek store and download the latest version of the Ecuador theme.
  2. Extract the zip file
  3. delete primefaces-ecuador.taglib.xml from src/main/webapp/WEB-INF/ in your project, it is no longer required
  4. in WEB-INF/lib, replace the 3.0.0 jar with the 6.1.0 jar from the extracted zip file
  5. delete the existing ecuador-layout from WEB-INF/resources and replace it with the new ecuador-layout from the extracted zip file

For full theme installation instructions, see here.

See the complete upgrade instructions on GitHub.

releasesBen PetitoComment