Version 5.0.x release note

Warning: This release note corresponds to a pre-release BETA stage platform, it may still be amended

(Open)JDK

As of this patchlevel, due to third party dependencies, the platform is compiled with a JDK 11.

The platform is thus not compliant any longer with any (Open)JDK prior to 11, the legacy (Open)JDK 1.8 in particular is not supported.

This means the recommended (Open)JDK to run the platform is still an up to date (Open)JDK (currently (Open)JDK 14) but at least an (Open)JDK 11.

Note: A fatal exception is now thrown if you use a unsupported (Open)JDK, preventing the webapp to start.

Bootstrap

See documentation to migrate your specific V3 components to V4 (https://getbootstrap.com/docs/4.0/migration).

It is strongly recommended to use the helpers $ui.view.tools to ignore the rendering implementation/version. For example, $ui.view.tools.panel will use a <panel/> in V3 and a <card/> in V4.

FullCalendar

Both versions V3 and V4 are included in the platform:

Compatibility breaking changes

/**
 * Platform Hooks
 */
public class PlatformHooks extends PlatformHooksInterface {
    public String parseAuth(Grant sys, SessionInfo info) {
        // same method but not static...
    }
    public boolean isMenuEnable(Grant g, String domain, String item) {
        // same method but not static...
    }   
}

Core changes

obj.resetFilters(); // a full scan of a big table
// New search with page callback
obj.search(true, 100, (rows) -> {
    // Called on each page of max 100 records
    for (String[] row : rows) {
        // do something with the record
    }
});

{
    "driver": "org.postgresql.Driver",
    "username": "<user>",
    "password": "<pwd>",
    "url": "postgresql://<server>:<port>/<database>",
    "jdbc": "/usr/share/java/postgresql-42.2.9.jar"
}

@Override
public String getExportFileName(String type, String name, String row[]) {
    if (HTTPTool.MEDIA_XLSX.equals(type) && row!=null)
        return "EXPORT" + "-" + row[getfieldIndex("myfield")] + "-" + Tool.getCurrentDate();
    return getDisplay();
}
@Override
public String isMergeEnable(List<String> ids) {
    if ( /* rule1... */ )
       return "ERR_NOT_ALLOWED_RULE1";
    return null; // OK
}

public String myAction(Action action) {
    String lang = getGrant().getLang();
    String param = action.getConfirmField(lang, "myStringField").getValue();
    ObjectField myDocField = action.getConfirmField(lang, "myDocField");
    DocumentDB doc = myDocField.getDocument();
    AppLog.info(getClass(), "myAction", "DOCUMENT " + doc, getGrant());
    if (doc!=null) {
        // Uploaded tmp file
        java.io.File file = doc.getUploadFile();
        AppLog.info(getClass(), "myAction", "DOCUMENT FILE " + file, getGrant());
        // do something with the document...
        // Remove the file from /tmp directory
        file.delete();
    }
    return null;
}

UI changes

List:

Form:

(function(ui) {
    var app = ui.getAjax();
    Simplicite.UI.hooks.MyObject = function(o, cbk) {
        function bind(ctn,obj,id) {
            var myField = ui.getUIField(ctn, obj, "myField", id);
            myField && myField.ui.on("change", function() {
                var myField2 = ui.getUIField(ctn, obj, "myField2", id);
                myField2 && myField2.ui.val(myField.ui.val() > 1000 ? "big" : "small");
            });
        }
        try {
            var p = o.locals.ui;
            p.form.onload = function(ctn, obj) {
                bind(ctn,obj);
            };
            p.list.onloadrow = function(ctn, obj, id) {
                bind(ctn,obj,id);
            };
        } catch(e) {
                app.error("Error in Simplicite.UI.hooks",e);
        } finally {
            cbk && cbk();
        }
    };
})(window.$ui);

List column:

Form rendering of thumbnails:

Drag&drop to upload N files:

Example of compacted Order:

@px: 16rem;
.myclass {
  /* font-size: 16px; */
  font-size: 16/@px; /* will generate 1rem */
  /* padding: 20px; */
  padding: 20/@px; /* will generate 1.25rem */
}

For example:

$(document).on("ui.ready", function() {
    $ui.options.onlogout = function() {
        var app = $ui.getAjax(),
            login = app.grant.login;
        // Save the session (navigation...)
        $ui.saveSession(function() {
            alert("Bye " + login + "!");
            // Call a SSO service
            $.ajax({
                url: app.sysparams.MY_SSO_LOGOUT_URL + "?user=" + encodeURIComponent(login)
            });
            $ui.quit(); // to invalidate session
        });
    };
});

Speaking:

Listening:

Fixes