Firestore server-side filtering in TMS WEB Core v1.7

To create a high performance web client application, a lot of things need to be taken in account. But foremost, when you create a modern SPA (single-page-application) architecture web client application, you will want to look at optimizing the communication of the application to your database back-end. In case you use the Google cloud based infrastructure as your database back-end, you will want to perform as little as possible requests and ensure that the data involved in these requests is as compact as possible. The server-side filtering capabilities of Google Firestore allow you to easily achieve this, especially with the new built-in support for it in the TWebFirestoreClientDataSet in TMS WEB Core.

Recalling loading and filtering features of TClientDataSet in classic VCL

If you have used a TClientDataSet in Delphi VCL, you already know that the component provides an in-memory table that can be manipulated easily and efficiently. But if there are a large number of records in a database, loading all of them in the TClientDataSet needs to be avoided. With traditional Delphi TClientDataSet, if the records are loaded through a DataSetProvider that supports queries then you can change those queries to load limited records based on a criteria. This approach greatly reduces the memory overhead of the TClientDataSet, since fewer records need to be stored in memory. 
Compare this with another option of local filters, also from standard Delphi VCL, where the number of records visible in the dataset can be reduced by using local filtering options. But that does not reduce the number of records in memory. It only restricts access to the records filtered out.
In Web Core, we give a solution similar to  DataSetProvider where certain filtering criteria can be applied at the Firestore to reduce the number of records fetched on opening the dataset.

New server-side filtering features in TWebFirestoreClientDataSet

The new server-side filtering features purpose is to limit the number of records fetched from a Firestore collection. Consider the problem when the Firestore collection has a large number of records. Loading all of them at once is not a good idea due to the memory overhead of an in-memory table in the TClientDataSet. 

In the new release of TMS WEB Core, the Firestore ClientDataSet component provides new features to apply filters to the data obtained at the Firestore end.
Important background information
Before we look at the details of each filtering method, it is necessary to understand some core principles.

1) Method names begin with “AddService”

There are several Firestore related filtering methods available in the Firestore ClientDataSet component.  They are named starting with “AddService” indicating that they are applied at the Firestore Service level. This is to differentiate them from any local filtering methods already available in the standard ClientDataSet.

2) Firestore filters are not as flexible as SQL queries 

The primary purpose of the Firestore filter methods is to limit the number of records fetched on opening the dataset in order to reduce the memory overhead. 
Don’t expect the Firestore filters to be as flexible as an SQL query for your data processing requirements. There are many restrictions and limitations as you will discover later. For an exanple, please see “Limitations and Gotchas” under AddServiceFilterCondition method later in this article. 
If you have advanced filtering requirements then in addition to the Firestore filters, you should use the local filtering features of the ClientDataSet for the advanced filtering needs.

3) Understand their mapping to the Firestore Filter API

It’s necessary to understand that each of the methods descibed in this article maps to a particular kind of query on the Firestore side, for example AddServiceFilterCondition maps to a “where” query on Firestore. 
The mappings are important to keep in mind so that you can refer to the proper Firestore documentation to look for more details on what works and what doesn’t. We can not possibly describe/repeat all the Firestore specific gotchas in the TMS WEB Core documentation.
For example, the description of the method AddServiceFilterCount in this article mentions the following mapping:
The “maps to” means that internally the component uses “Firestore limit query.” So if you are a curious type and want complete details on “Firestore limit queries,” please go to the Firestore documentation on that keyword.

4) Many Filters depend on the current Sort order that you need to set up before calling the filter

For some of the Firestore filters, you need to sort on the field being used. This can be done by using the calls ClearSortFieldDefs and AddSortFieldDef. Note that this sorting happens at the Firestore end.
Here is an example of setting up a sort on the age field.
fireStoreCDS.ClearSortFieldDefs;
fireStoreCDS.AddSortFieldDef(
                   'age', // field name
                   true); // is ascending


5) The Filtering Methods

AddServiceFilterCount method (Maps to: Firestore “limit” query)
You can limit the number of records obtained by this method on an Open. You need to set it before calling Open.
Example:
The following filter when set up will fetch only 100 records on open.
fireStoreCDS.AddServiceFilterCount(100);
Usage notes:
  • If you have set up a sort order, they will be first 100 records in that sort order.
  • How do you get the next 100 records? Use the method AddServiceFilterContinueAfterLast described next.
AddServiceFilterContinueAfterLast method for pagination (Maps to: Firestore pagination)
This is the method that sets up the pagination to get the next set of records. You need to call Refresh after this. Then you can call Refresh again and again to get the next set of records or pages.
For example, if you call it after the above example of AddServiceFilterCount and call Refresh, it will fetch the next 100 records. Subsequently, just call Refresh to get the next set and so on till you get an empty dataset.
Usage notes:
AddServiceFilterContinueAfterLast can also be used after the AddServiceFilterRange method described later. But it also requires to clear filters and set a new range. Please see the Filters demo for the actual code. 
AddServiceFilterCondition method  (Maps to: Firestore “where” query)
Use this method to specify a where condition filter. Setting the filter activates it on the next Open or Refresh. 
Requirement:
If you are using a Sort Order by using a AddSortFieldDef call, it must be on the same field that you are using in this filter.
Examples:
1. Get records where field “status” has the value “New”
fireStoreCDS.AddServiceFilterCondition('status', '==', 'New');
2. Use more than once to specify multiple conditions ANDed but for the same field. 
fireStoreCDS.AddServiceFilterCondition('age', '>', 18);
fireStoreCDS.AddServiceFilterCondition('age', '<', 65);
3. For an OR condition, use the “in” operator. For example, to get records where field “status” has the value “New” or “Pending”
fireStoreCDS.AddServiceFilterCondition('status', 'in', TJSArray.New('New', 'Pending'));

Limitations and gotchas:
  • Date/Time fields require special code. This is described in Web Core documentation of Firestore.
  • This filter maps to Firestore “where” that is much limited as compared to SQL’s “where.” For example, one of the rules says, you can add more than one where filters, provided they are on the same field and if a Sort Order is being used, the Sort Order must be on the same field. To give you another example, the example 2 above works as AND. But if you want to use a similar OR condition, it’s not easily possible. People have written articles on such problems that you can find on the Internet by searching for Firestore where query problems with proper keywords.
  • It’s not possible to describe all possible rules and usage of Firestore “where” filter in this article or even in the Web Core documentation. For more details, please refer to the Firestore document “Querying and filtering data” (search Google on this) and refer to the section on “where” queries. 
AddServiceFilterRange method (Maps to: Firestore filters startAt, startAfter, endAt, endBefore)
Use this method to specify a Firestore “start” and/or “end” condition on a value that refers to the current sort field set by AddSortFieldDef call. Setting the range filter activates it on next Refresh or Open call. 
Requirement:
The value passed works on the current sort field. So you must have defined a sort order by AddSortFieldDef call.
Example:
Suppose you have defined the sort on the “age” field by AddSortFieldDef
fireStoreCDS.ClearSortFieldDefs;
fireStoreCDS.AddSortFieldDef("age", true);
Now you want to start at age 18 and end at age 65. You will use 2 filters.
fireStoreCDS.AddServiceFilterCondition(frStartAt, 18);
fireStoreCDS.AddServiceFilterCondition(frEndAt, 65);
Limitations and gotchas:
  • Date/Time fields require special code. This is described in TMS WEB Core documentation of Firestore.
ClearServiceFilters
Clears all the Firestore filters set up so that all the records are obtained on the next open or refresh.

New Firestore Filtering Demo

A demo is available that shows use of the above filtering methods. You will find this demo under Demo\Services\Firestore.
There are 2 parts to this demo, an import utility that imports 500 JSON objects to a Firestore collection as a prerequisite for the demo and then the Demo itself that filters the collection when obtaining data.
Preparing for the Filter Demo: Build and Run the Import Utility
In the Firestore Filters Demo folder under “Demo\Services,” you will find a project ImportTestData. 
Please follow these steps:

  1. Open the project TMSWeb_ImportTestData
  2. Build and Run the project
  3. Enter values for API Key, AuthDomain and ProjectID if they are not automatically filled by your previous usage of any Firestore demo. 
  4. Click on Import Test Data.
This should import 500 objects from the JSON file in a new collection called SalesData. You can verify that the data is imported to such a collection in the Firestore Console. Also, in case you want to recreate this collection due to any problems, you can delete the colleciton in Firestore console and import again.
Running the Filters Demo
Please follow these steps:

  1. Open the project TMSWeb_FirestoreFilters.
  2. If you didn’t change the Collection name when importing, just Build the project. Otherwise, please search for CUSTOMIZE comment and use the same collection name here in which you imported the data above.
  3. Now run the project.
  4. Click on the Filters items one by one and see how they work.
  5. To look at how the actual filters are used in code, please see the procedure setupExampleFilter.

Summary

  • First, we recalled the Loading and Filtering features of TClientDataSet from Delphi VCL. This was necessary to understand the memory limitations of TClientDataSet.
  • Next, the article stressed on some background information that is necessary to understand before going into the Firestore filtering methods.
  • This was followed with the actual description of the Firestore filtering methods along with examples, usage notes and limitations.
  • Then we looked at the Firestore Filtering Demo that uses the filtering methods of the component.

Of course, everything you learned here applies to TMS WEB Core for Delphi or Lazarus as well as TMS WEB Core for Visual Studio Code.

What’s next

In the next part 4 of this series, we are going to take a look at the new Async methods to perform database operations in code. In particular, we show you how to wait for the result of the previous operation before performing the next operation in a world of async Firestore updates.

Read More

Read More

GExperts bug: CTRL+V on FMX form designer inserts into secondary editor window

I got a bug report for GExperts and Delphi 10.4 that’s really curious: When a secondary editor window is open in the IDE and the FMX form designer is active, trying to insert a component from the clipboard into the form inserts the textual description of that component into the editor windows instead. I could immediately reproduce this but finding the culprit took quite a bit longer. Observation 1: It does not happen for the VCL form designer. Observation 2: It only happens, if you use CTRL+V to insert the component. The form designer’s context menu entry works fine. Observation 3: Even disabling all experts in GExperts did not solve this problems… Until you restart the IDE, then it’s gone, even if you then enabled the experts again… Until you restart the IDE again which brings it back. After a lot of trial and error I found that the cause are two of the GExperts editor experts: Goto Previous Modification Goto Next Modification Disabling these experts and restarting the IDE solves the problem. These are rather simple experts that only add entries to the editor window’s context menu for a functionality that already is part of the IDE. I added them to make that functionality more visible, and because I could. Since Delphi 10.3 I had to use a workaround to still be able to add entries to that menu because apparently it is being recreated in the OnPopup event. I think this code somehow activates the menu entries or their associated actions even if the editor window doesn’t have the focus. So for now until I find a real workaround: If you have this problem, disable these two experts. (The workaround might be to remove these experts altogether. They aren’t that useful anyway.) If you want to comment on this blog post, you can do so in the corresponding topic in the international Delphi Praxis forum.
Read More

Turbo Boost Your Delphi Knowledge – Become a Docwiki Ninja Warrior

I’ve made a commitment to learn FireMonkey. My flagship software product, Zilch Standard, turned 30 years old in 2021 and I still don’t have a macOS version. I’ve got macOS consumers who buy my Windows® software and then email asking if there’s a version that runs on their mac computer. This inevitably leads to me issuing a refund. So, I have a pretty strong incentive to learn FireMonkey.

“I feel like I’m sitting in the cockpit of an airplane.”

I tried going down the FireMonkey learning path before but unfortunately I didn’t get very far. Learning FireMonkey makes me feel like I’m sitting in the cockpit of an airplane. There’s so many things that are unfamiliar. The scope of it all is overwhelming. There’s so much to learn. I don’t know where to look first. What about the help? It’s just an [F1] key press away!

I don’t know about you but I get frustrated at the built-in help that comes with Delphi? Does this sound familiar? You’re frantically trying to figure something out… pressing [F1] all over the place, and hopelessly rummaging around through Delphi’s built-in help. Sometimes it’s great and gives you what you exactly what are looking for. Often times you are left feeling like you just read a bunch of cryptic tea leaves. 

Where do you turn at this point? The Facebook Delphi groups? Stackoverflow?  Your stash of Delphi books? Delphi’s dockwiki?
In the past I’ve rarely thought to use Delphi’s docwiki. In my mind I felt like it was the same rehashed [F1], cryptic leaves stuff. Well, that changed last night. 
It turns out, I wasn’t using the dockwiki in a meaningful way. I figured out how to exploit the value of the docwiki. I’m going to show you how to become a docwiki ninja warrior.

“I’ll show you how to become a Delphi Docwiki Ninja”

It all started last night when I wanted to learn more about FormFactor. I wrote a simple FMX application that displays the ClientHeight, ClientWidth, FormFactor.Width, and FormFactor.Height in the OnResize event handler. I was curious why the FormFactor values never changed as the form was resized, so I wanted to learn more. That’s when I highlighted FormFactor in the Object Inspector and pushed [F1] .

This brought up the built-in help for FormFactor. This is one of those cryptic tea leaves help reference.

This wasn’t very helpful. I may have done some googling to learn more but couldn’t find anything that talked about FormFactor. What it is? How it’s used? Why it’s used? So I posted my question to StackOverflow
Someone commented and said “Please look at the documentation. It seems to concern iOS only, and changes according target device selection.”
How did he find that docwiki page? That’s not the docwiki page I found. In fact I couldn’t find the dockwiki page referenced in StackOverflow comment. Turns out I didn’t understand how to use the dockwiki. I was stuck in the API library and couldn’t got out!

I was stuck in the API library and couldn’t get out!

That’s when I discovered how to become a Docwiki Ninja Warrior. This takes less than a minute to setup and I believe it will save you hours looking for information about Delphi that is relevant to what you are looking for. For illustrative purposes I’m sticking with my original pursuit of FormFactor.
Step 1: From inside the IDE click Help > RAD Studio Docwiki

Step 2: This opens the RAD Studio docwiki page in your default browser.
Step 3: Right-click on Library Reference > Open link in new tab 

Step 4: This opens the Library docwiki page in a new browser tab.
Step 5: Right-click on Code Example > Open link in a new tab.

At this point you should have three tabs in your browser each dedicated to separate docwiki sections. And now the fun begins.
Step 6: Enter FormFactor in the search box for tab 1 RAD Studio and press [Enter]. I’m horrible at spelling so I usually just copy and paste the value I need. I just highlighted FormFactor in the IDE code editor and pasted it in the search box. 

Step 7: Switch to tab 2 Library docwiki page and paste or enter FormFactor in the search box and press [Enter].

Step 8: Switch to tab 3 Code Examples docwiki and paste or enter FormFactor in the search box and press [Enter].

“So, what did I learn about FormFactor?”

FormFactor is only used used when you are creating an iOS application. This is awesome. I learned enough about FormFactor to satisfy my current need. Because I’m focused right now on learning how to use FireMonkey to create desktop applications for Windows and macOS, FormFactor is not relevant to my current situation. This lets me know I can skip a thorough investigation about FormFactor for the time being. It also lets me know that ignoring FormFactor at this time is okay since it does not apply to desktop applications for Windows or macOS. I don’t need to be concearned about FOMO (fear of missing out).

However, if FormFactor was something I was interested in, the three different docwikis provide ample links to related, relevant, information in one convenient location. 
Oh yeah, make sure to play around with the “Advanced” link on the special search results pages.
There you have it. I am so glad I stumbled upon this. It will surely be very helpful in my quest to learn FireMonkey. 
Enjoy!
Semper Fi,
Gunny Mike

Read More

Read More

SAPI (Microsoft Speech API) problems with the IDE

Every few months or so someone sends me an email telling me they’ve speech-enabled their application with SAPI (the Microsoft Speech API) after having read my old coverage (specifically that for SAPI 5.1) from conferences in 2002 and before. It’s always good to hear that stuff you’ve worked on is being found useful, even long after you did it, in this case frighteningly close to 2 decades ago (Ͼ˳Ͽ)..!!!

Sometimes the communications are asking how to do specific things with SAPI – unfortunately those are typically a dead end, as I haven’t used SAPI in anger for a long while.

Sometimes, though, people are stuck on the basics and I was recently contacted by someone with a fairly current version of RAD Studio saying they couldn’t get started at all. It turns out that the current version of SAPI, SAPI 5.4, cannot be imported into RAD Studio!

Uh-oh. Time to investigate…

The steps to import SAPI components into the IDE is as follows (and is documented here):

  • Choose Component, Import Component… (as mentioned in the documentation)
  • Select Import a Type Library and press Next
  • Choose the Microsoft Speech Object Library that is defined in sapi.dll:
  • Press Next and choose a target Palette Page:
  • Press Next, select Install to New Package and press Next again
  • Now choose a value for Package name (and optionally for Description) and press Finish:
At this point the package will be created and a type library import unit is added to it and the IDE will try to build the package. Immediately something is flagged up:

Click Yes and the package will start building proper. This is where it all falls apart:

Hmm, is there a massive FUBAR in the type library importer? Sure looks like that could be the case….
However, upon closer inspection the issue actually comes up thanks to the SAPI type library defining its own versions of the already-defined-in-Delphi interfaces IStream and ISequentialStream. In the SAPI versions they have extra methods, references to which then fail to compile thanks to those methods not being imported.

Why are those ‘known’ interfaces not imported? Well, the idea is to avoid ambiguity with having multiple definitions, but that’s not important as… we can override this omission!

In your RAD Studio bin folder (e.g. C:\Program Files (x86)\Embarcadero\Studio\21.0\bin) you will find a file called tlibimp.sym. This is the configuration file for the type library importers (both the one in the IDE we just used and also the command-line utility TLibImp.exe). The content of this configuration file affect the way type libraries get imported to help cover various trouble areas. In this case we need to remove some settings to get the SAPI type library imported.

Here is a part of tlibimp.sym:

;;===================================================================;;
;; Names listed in this section are skipped by the importer         
;; Built-in Interfaces, such as IUnknown and IDispatch are listed
;; here
;;===================================================================;;
[BuiltInInterfaces]
{00020400-0000-0000-C000-000000000046}=IDispatch
{00000000-0000-0000-C000-000000000046}=IUnknown
{0000000C-0000-0000-C000-000000000046}=IStream
{0C733A30-2A1C-11CE-ADE5-00AA0044773D}=ISequentialStream
We need to comment out the IStream and ISequentialStream lines to get a successful import. Once those 2 lines have semicolons inserted at their start we can try again.

Remove the emitted import unit SpeechLib_TLB.pas from the package still open in the IDE, then delete that unit from disk and close the package project.

Now you can go through the steps above again, but this time instead of selecting Install to New Package you select Install to Existing Package. After pressing Next you press Browse and locate the original DCLSAPI54.dpk project file, which by default will have been saved in the default Delphi projects folder (Embarcadero\Studio\Projects within your Documents folder tree).

This time the package will build and you will be told of the component wrappers now installed in the IDE:

If you want to import the SAPI type library from a RAD Studio Command Prompt you can run this command:

tlibimp -P -Yh+ -Yr+ -HpsActiveX C:\WINDOWS\System32\Speech\Common\sapi.dll

Note that the SAPI 5.x sample applications from the 2002 conference paper have been updated and are available along with an updated import package at these URLs:

Read More

Read More

What’s coming in TMS WEB Core v1.7 Ancona


The new version v1.7 of TMS WEB Core has
been in development for about 6 months by now. Many of its features were
already in development in parallel to v1.6. And yes, our team already is working
on v1.8! It will not come as a surprise to you that in v1.7 there are new
game-changing features in TMS WEB Core also.

Those who have been following the TMS WEB
Core development since the first version TMS WEB Core v1.0 Brescia will know
that we name the releases after cities along the famous historic race “MilleMiglia”. To be more precise, the legendary race of 1955. And as such, after we
visited the city Pesaro with v1.6, for v1.7 we land in Ancona. The historical
meaning of the word “Ancona” is elbow which is commonly associated with the
shape of the coastline. After the ‘elbow’ Ancona, there are new sights towards
the more southern coasts of Italy.

Enough history! Let’s bring an overview of
what our team has been working on for TMS WEB Core v1.7 Ancona.

1) Components wrapping browser API for local file access

The W3C consortium proposed an API forlocal file access from Web browser applications and Google Chrome implements it
already. Given that Microsoft uses the Google Chromium engine, it is also available
in Microsoft Edge Chromium. With TMS WEB Core, you can take a head start, explore,
and start using this with its three components today:

  • TWebLocalTextFile
  • TWebLocalBinaryFile
  • TWebLocalFolder.

These components allow you to directly open
text and binary files from the local file system as well as traverse the local
file system’s folder structure from a Web application. Of course, for security
reasons, the users have to give their consent first.

2) Popup menu component and popup menu support in components

In TMS WEB Core, we offered the regular
TWebMainMenu since its inception and now we completed this trend with the new
TWebPopupMenu. It works very similar to a Windows VCL TPopupMenu. Simply drop a
TWebPopupMenu on your Web forms and assign it to control.PopupMenu to obtain an
automatic context menu for controls.


3) USB device access


The times that software developers thought
you could never use a Web application for controlling your machine’s hardware
are officially over. We already introduced support for Bluetooth with our
TWebBluetooth component, and with this release we add two new components
TWebUSBSerial and TWebUSBHID that allow you to write applications communicating
with locally connected USB devices using a serial protocol or the HID protocol.
This opens up a whole new field of applications that can be implemented using Web
technologies.


4) TWebStringGrid & TWebDBGrid extensions

We added a whole range of new grid features
in TWebStringGrid and TWebDBGrid. There are now:

  • Methods to insert & remove rows
  • A range of different inplace editor types
  • Cell merging and cell splitting
  • Loading and saving to streams
  • Loading from a stringlist with CSV data
  • Direct access to grid data as TJSArray
  • Add checkboxes to the grid

5) Async methods

There is no way around it in the Web
browser, there are different APIs that can only be used in an asynchronous way.
The reason for this is very clear: Always guarantee a responsive UI even when
lengthy operations are taking place in the application.

Many developers struggle with implementing
sequential logic for processes that occur asynchronously. We already offered
anonymous methods that can be used to handle results of methods asynchronously,
but, in v1.7, we added a whole range of async methods to classes. With a simple
await() construct around an async method, you can write your code as-if it were
synchronous and sequential, but, behind the scenes, the browser still handles
it asynchronously and keeps your UI responsive. The components to perform HTTP(S)
requests for example, load data from a URL, load images from URL, etc… now
all have async equivalents making you write code that is cleaner and consequently
easier to maintain.

var
  ms: TMemoryStream;
begin
  ms := TMemoryStream.Create;
  try
    await(boolean,ABinaryFile.LoadStream(ms));
    ms.Position := 0;
    webmemo2.lines.LoadFromStream(ms);
  finally
    ms.Free;
  end;
end;

6) Miletus framework

This is probably the biggest feature of TMS WEB Core v1.7! Miletus is a framework for creating native desktop applications with Web technologies. It permits to create wonderful and modern user-interfaces using (and in many cases reusing) HTML/CSS templates.

Still, it allows to run as a desktop application and to access desktop features normally reserved for a native desktop app. This includes:

  • local file access
  • operating system menu
  • drag & drop interaction
    with the operating system
  • access to the taskbar
  • access to local databases (SQLite, MSSQL, PostgreSQL, mySQL, MS Access)
  • so much more… 

This first introduction of Miletus in TMS
WEB Core offers the capability to create Win32 and Win64 native single EXE file
applications with a size below 10MB. And in the near future, we will add macOS
and Linux to that.

Stay tuned for another blog with a more
detailed overview of the Miletus features. An additional benefit of Miletus is
that we developed this framework from the ground up as opposed to a similar
framework called Electron that is from a 3rd party. This means that for the
future, we have full control to design any feature set we want for Miletus.

7) TWebSocketClient method added to send & receive binary data

When communicating with a web socket
server, TWebSocketClient can now directly send & receive binary data
whereas in previous versions this had to be sent as Base64 encoded string data.

8) TWebForm extended

We added more flexibility to the TWebForm. This includes:

  • Option to have a close button in the caption
  • Property to choose whether a shadow border is used or not
  • ElementCaptionClassName property added to allow the use of CSS for the caption
  • OnDOMContentLoaded event added, that signals when the browser loaded the entire DOM content
  • OnHashChange event added to handle browser back & forward buttons

9) New server-side filtering + multi-tenant support in TWebFireStoreClientDataSet

We have also significantly improved
TWebFireStoreClientDataSet. Now, TWebFireStoreClientDataSet supports to create
more flexible and more performant Web client applications using Google’s
Firestore as the backend for data storage. In the new version, it is possible
to specify server-side filters. This facilitates not only multi-tenant
scenarios but also increases performance by minimizing data returned from the
server.

10) Numerous smaller extensions & improvements to various components & IDE integration

Not only was the TMS WEB Core framework improved
in almost any corner, the IDE integration got further fine-tuning as well. The
capability to use environment variables in the compiler path with the $()
syntax was added. The same is possible with custom compiler directives. And
finally, also the pas2js compiler & RTL were updated to the latest version
v2.0.4.

Planning

The first step is that we will release the
beta version of TMS WEB Core v1.7 in the next few days to all TMS ALL-ACCESS
users and registered users of TMS WEB Core. We expect the upgrade process
should be smooth and painless as we paid a huge amount of attention to
backwards compatibility. This is proven by the fact that we did not have to make
any modifications to the meanwhile over 100 demos included. However, we want to
put the v1.7 beta into your hands first and listen closely to your feedback.
That allows us to apply further polish where needed.

After this beta period, TMS WEB Core v1.7
Ancona will be officially released, and our team will continue to work hard on
the next milestones.

TMS WEB Core for Visual Studio Code v1.3

The new version v1.3 of TMS WEB Core for Visual Studio Code is also around the
corner. The major new feature of v1.3 will be extensibility via 3rd party
components with a package system and with this, the whole portfolio of
TMS FNC components will also become usable at design-time in Visual Studio Code. The
TMS WEB Core framework will be at the same level as TMS WEB Core v1.7 for
Delphi & Lazarus. The only feature that will not yet be included in TMS WEB
Core for Visual Studio Code v1.3 is Miletus support. That is reserved for v1.4
and with this, it is expected to already bring Miletus for Windows, macOS, and
Linux.

TMS WEB Core v1.8

There are several ongoing new developments
for TMS WEB Core that we cannot reveal yet, but it is clear that v1.8 will come
with Miletus support for macOS and Linux. We already have proof of concept
versions working in the lab, but further work is needed before this is
considered “feature complete”. This will very likely be the case in v1.8.

Get started today!

The only constant in software development is change. Web technologies open up exciting new capabilities for us Delphi, Lazarus, or Object Pascal developers in general. It allows us to create with RAD component-based techniques and a strongly-typed object-oriented language no-deploy web applications. Further, we may create PWAs for iOS and Android that can be installed and run offline when needed. Best of all, we do not need to conform to Apple or Google store censorship. Alternatively, you can create  cross-platform desktop applications with Electron or Miletus at the same time. 

We are of course curious to hear what you like the most about TMS WEB Core v1.7 Ancona or what you wish to see in future versions of TMS WEB Core! We look forward to discussing all these great milestones with you!

Webinar

If you want to see the new capabilities in TMS WEB Core 1.7 Ancona demonstrated live and ask questions, we have organized this opportunity for you! Attend our free webinar on April 8, 2021, from 15h00 to 16h00 UTC (17h00 – 18h00 CEST).  Register for the webinar here.

Read More

Read More

What’s cooking in the TMS Labs: moving Delphi and FNC forward (and backward)!

Our ever growing FNC framework now already brings a whole portfolio of components to a myriad of devices and operating systems: Windows, Android, iOS, macOS, Linux, Raspbian, Web ….
So, it is clear that our R&D team is always looking out for new technology and trying to be ahead of the curve. For this reason, our team was excited to be involved in a very forward looking project for a customer that brings Delphi and our FNC framework again on the bleeding edge of technology. 
For this project, we researched how we could bring the FNC framework to a new M1 CPU + NVidia Titan V based device that features an AI driven holographic display. We tweaked the Delphi OSX64 compiler to produce M1 CPU code as well as NVidia SIMD GPU instructions to render FNC on the holographic display. When we received the test device here, the results are without a doubt stunning! You can see a glimpse here:
While playing with this cutting-edge technology, our team mesmerized how predictions of technology in movies of the seventies and eighties already got real and we wondered therefore, if we could bring Delphi and FNC at the same time to this for us nostalgic area. A first attempt was to port FNC to the Sharp LR35902 processor and after this was successful, it permitted us to run FNC on the Nintendo Game Boy. It is surprising how crisp the FNC graphics are rendered on the small Game Boy LCD screen as you can witness here:
And this achievement inspired us to go back in time even further. Surprisingly this was somewhat easier as making Delphi compile on a Intel 8080 CP/M machine. We tweaked the original Turbo Pascal 8086 compiler to use only 8080 instructions and got it working. It was however a lot more effort to downscale the FNC graphics abstraction layer to a 80×25 character CRT screen. But as you know by now, we are not scared to make our hands dirty in such challenging task. It is with pride that we can share the first FNC components now also running on a CP/M driven Intel 8080 machine from 1974 connected to a Sperry Univac Uniscope 200 terminal. 

Are you still using devices for which you like to use Delphi and FNC? Let us know, it could become the next challenge of our team! We look forward to hear what nostalgic or futuristic device you would which to bring alive with your beloved development tools.
If you read this far, we hope you did not overlook the date this blog was published and you see that the FNC technology is as a fish in the water on every platform

Read More

Read More

What’s coming in TMS WEB Core v1.7 Ancona


The new version v1.7 of TMS WEB Core has
been in development for about 6 months by now. Many of its features were
already in development in parallel to v1.6. And yes, our team already is working
on v1.8! It will not come as a surprise to you that in v1.7 there are new
game-changing features in TMS WEB Core also.

Those who have been following the TMS WEB
Core development since the first version TMS WEB Core v1.0 Brescia will know
that we name the releases after cities along the famous historic race “MilleMiglia”. To be more precise, the legendary race of 1955. And as such, after we
visited the city Pesaro with v1.6, for v1.7 we land in Ancona. The historical
meaning of the word “Ancona” is elbow which is commonly associated with the
shape of the coastline. After the ‘elbow’ Ancona, there are new sights towards
the more southern coasts of Italy.

Enough history! Let’s bring an overview of
what our team has been working on for TMS WEB Core v1.7 Ancona.

1) Components wrapping browser API for local file access

The W3C consortium proposed an API forlocal file access from Web browser applications and Google Chrome implements it
already. Given that Microsoft uses the Google Chromium engine, it is also available
in Microsoft Edge Chromium. With TMS WEB Core, you can take a head start, explore,
and start using this with its three components today:

  • TWebLocalTextFile
  • TWebLocalBinaryFile
  • TWebLocalFolder.

These components allow you to directly open
text and binary files from the local file system as well as traverse the local
file system’s folder structure from a Web application. Of course, for security
reasons, the users have to give their consent first.

2) Popup menu component and popup menu support in components

In TMS WEB Core, we offered the regular
TWebMainMenu since its inception and now we completed this trend with the new
TWebPopupMenu. It works very similar to a Windows VCL TPopupMenu. Simply drop a
TWebPopupMenu on your Web forms and assign it to control.PopupMenu to obtain an
automatic context menu for controls.


3) USB device access


The times that software developers thought
you could never use a Web application for controlling your machine’s hardware
are officially over. We already introduced support for Bluetooth with our
TWebBluetooth component, and with this release we add two new components
TWebUSBSerial and TWebUSBHID that allow you to write applications communicating
with locally connected USB devices using a serial protocol or the HID protocol.
This opens up a whole new field of applications that can be implemented using Web
technologies.


4) TWebStringGrid & TWebDBGrid extensions

We added a whole range of new grid features
in TWebStringGrid and TWebDBGrid. There are now:

  • Methods to insert & remove rows
  • A range of different inplace editor types
  • Cell merging and cell splitting
  • Loading and saving to streams
  • Loading from a stringlist with CSV data
  • Direct access to grid data as TJSArray
  • Add checkboxes to the grid

5) Async methods

There is no way around it in the Web
browser, there are different APIs that can only be used in an asynchronous way.
The reason for this is very clear: Always guarantee a responsive UI even when
lengthy operations are taking place in the application.

Many developers struggle with implementing
sequential logic for processes that occur asynchronously. We already offered
anonymous methods that can be used to handle results of methods asynchronously,
but, in v1.7, we added a whole range of async methods to classes. With a simple
await() construct around an async method, you can write your code as-if it were
synchronous and sequential, but, behind the scenes, the browser still handles
it asynchronously and keeps your UI responsive. The components to perform HTTP(S)
requests for example, load data from a URL, load images from URL, etc… now
all have async equivalents making you write code that is cleaner and consequently
easier to maintain.

var
  ms: TMemoryStream;
begin
  ms := TMemoryStream.Create;
  try
    await(boolean,ABinaryFile.LoadStream(ms));
    ms.Position := 0;
    webmemo2.lines.LoadFromStream(ms);
  finally
    ms.Free;
  end;
end;

6) Miletus framework

This is probably the biggest feature of TMS WEB Core v1.7! Miletus is a framework for creating native desktop applications with Web technologies. It permits to create wonderful and modern user-interfaces using (and in many cases reusing) HTML/CSS templates.

Still, it allows to run as a desktop application and to access desktop features normally reserved for a native desktop app. This includes:

  • local file access
  • operating system menu
  • drag & drop interaction
    with the operating system
  • access to the taskbar
  • access to local databases (SQLite, MSSQL, PostgreSQL, mySQL, MS Access)
  • so much more… 

This first introduction of Miletus in TMS
WEB Core offers the capability to create Win32 and Win64 native single EXE file
applications with a size below 10MB. And in the near future, we will add macOS
and Linux to that.

Stay tuned for another blog with a more
detailed overview of the Miletus features. An additional benefit of Miletus is
that we developed this framework from the ground up as opposed to a similar
framework called Electron that is from a 3rd party. This means that for the
future, we have full control to design any feature set we want for Miletus.

7) TWebSocketClient method added to send & receive binary data

When communicating with a web socket
server, TWebSocketClient can now directly send & receive binary data
whereas in previous versions this had to be sent as Base64 encoded string data.

8) TWebForm extended

We added more flexibility to the TWebForm. This includes:

  • Option to have a close button in the caption
  • Property to choose whether a shadow border is used or not
  • ElementCaptionClassName property added to allow the use of CSS for the caption
  • OnDOMContentLoaded event added, that signals when the browser loaded the entire DOM content
  • OnHashChange event added to handle browser back & forward buttons

9) New server-side filtering + multi-tenant support in TWebFireStoreClientDataSet

We have also significantly improved
TWebFireStoreClientDataSet. Now, TWebFireStoreClientDataSet supports to create
more flexible and more performant Web client applications using Google’s
Firestore as the backend for data storage. In the new version, it is possible
to specify server-side filters. This facilitates not only multi-tenant
scenarios but also increases performance by minimizing data returned from the
server.

10) Numerous smaller extensions & improvements to various components & IDE integration

Not only was the TMS WEB Core framework improved
in almost any corner, the IDE integration got further fine-tuning as well. The
capability to use environment variables in the compiler path with the $()
syntax was added. The same is possible with custom compiler directives. And
finally, also the pas2js compiler & RTL were updated to the latest version
v2.0.4.

Planning

The first step is that we will release the
beta version of TMS WEB Core v1.7 in the next few days to all TMS ALL-ACCESS
users and registered users of TMS WEB Core. We expect the upgrade process
should be smooth and painless as we paid a huge amount of attention to
backwards compatibility. This is proven by the fact that we did not have to make
any modifications to the meanwhile over 100 demos included. However, we want to
put the v1.7 beta into your hands first and listen closely to your feedback.
That allows us to apply further polish where needed.

After this beta period, TMS WEB Core v1.7
Ancona will be officially released, and our team will continue to work hard on
the next milestones.

TMS WEB Core for Visual Studio Code v1.3

The new version v1.3 of TMS WEB Core for Visual Studio Code is also around the
corner. The major new feature of v1.3 will be extensibility via 3rd party
components with a package system and with this, the whole portfolio of
TMS FNC components will also become usable at design-time in Visual Studio Code. The
TMS WEB Core framework will be at the same level as TMS WEB Core v1.7 for
Delphi & Lazarus. The only feature that will not yet be included in TMS WEB
Core for Visual Studio Code v1.3 is Miletus support. That is reserved for v1.4
and with this, it is expected to already bring Miletus for Windows, macOS, and
Linux.

TMS WEB Core v1.8

There are several ongoing new developments
for TMS WEB Core that we cannot reveal yet, but it is clear that v1.8 will come
with Miletus support for macOS and Linux. We already have proof of concept
versions working in the lab, but further work is needed before this is
considered “feature complete”. This will very likely be the case in v1.8.

Get started today!

The only constant in software development is change. Web technologies open up exciting new capabilities for us Delphi, Lazarus, or Object Pascal developers in general. It allows us to create with RAD component-based techniques and a strongly-typed object-oriented language no-deploy web applications. Further, we may create PWAs for iOS and Android that can be installed and run offline when needed. Best of all, we do not need to conform to Apple or Google store censorship. Alternatively, you can create  cross-platform desktop applications with Electron or Miletus at the same time. 

We are of course curious to hear what you like the most about TMS WEB Core v1.7 Ancona or what you wish to see in future versions of TMS WEB Core! We look forward to discussing all these great milestones with you!

Webinar

If you want to see the new capabilities in TMS WEB Core 1.7 Ancona demonstrated live and ask questions, we have organized this opportunity for you! Attend our free webinar on April 8, 2021, from 15h00 to 16h00 UTC (17h00 – 18h00 CEST).  Register for the webinar here.

Read More

Read More

REST API Server with Delphi and XData 5: Read and Watch

TMS XData 5 has been released with lots of new features!

Photo by Glenn Carstens-Peters on Unsplash

In addition to the recent release of TMS Aurelius 5, a new major version of TMS XData has been also released.

TMS XData 5 is the fifth major version of our framework to build multitier applications, including REST API server, and interface-based API client. It makes it easy to build server-side services that reach a broad range of clients, including browsers and mobile devices.

Among several features, TMS XData provides:

  • Automatic serialization/deserialization of pure Delphi objects, primitive types, method parameters;
  • Authentication and Authorization;
  • Powerful routing mechanism: route endpoints to methods in your code;
  • Automatic, zero-code Swagger/SwaggerUI support;
  • Interface-based client allows type-safe client applications without additional code;
  • Smooth TMS Aurelius integration allows CRUD endpoints of database entities automatically.

The new features released with XData 5 were also antecipated in a previous blog post,

The what’s new section in the documentation provides you with a full list, but here we will list a few:

Attribute-based Authorization

Developers will be able to just add authorization attributes to methods (service operations) or entities (automatic CRUD endpoints) and everything will be applied accordingly. Fine-tuning the protection of your REST API will never be as simple.

  [Authorize]
  IDocumentService = interface(IInvokable)
    procedure Insert(Value: TDoc);

    [AuthorizeScopes('user, editor')]
    procedure Modify(Value: TDoc);

    [AuthorizeScopes('admin')]
    procedure Delete(DocId: string);

    [AuthorizeClaims('email')]
    procedure Approve(DocId: string);
  end;

In the example above, all methods (endpoints) require authentication, because the interface has an Authorize attribute that propagates to all methods. So, to invoke Insert, user must be authenticated. Still, to invoke Modify, the user must be authenticated and have either user or editor scope in its credentials. He must be admin to invoke Delete, and finally to approve a document, user must have an email in its claims.

It’s also worth noting that the same strategy applies to entities that generate automatic CRUD endpoints:

  [Entity, Automapping]
  [EntityAuthorize]
  [EntityAuthorizeScopes('editor', [TEntitySetPermission.Modify, TEntitySetPermission.Insert])]
  [EntityAuthorizeScopes('admin', [TEntitySetPermission.Delete])]
  TCustomer = class
  {...}
  public
    property Id: Integer read FId write FId;
    property Name: string read FName write FName;
  end;

To access customer endpoints, user must be authenticated. But he must have editor privileges to modify and insert (PUT and POST) and must be admin to invoke DELETE. Easy and straightforward.

Async/Await Support in Web Applications

TMS XData is smoothly integrated with TMS Web Core, the TMS framework to build web applications.

Now your can use async/await mechanism in TXDataWebClient methods that invoke XData server endpoints. As an example, invoking a XData REST API endpoint asynchronously will be as easy as doing this:

PendingOrders := await(XClient.List<TOrder>('$filter=Status eq pending'));
if PendingOrders.Count = 0 then
  Exit; // no pending orders to process

The single line above will build the HTTP request with proper URL endpoint and HTTP method, invoke it, deserialize the returned JSON into a list of TOrder objects, and all asynchronously! The await function will guarantee that the next line will be executed only after the async execution is executed. Can’t get easier than that.

Multitenant Servers

This is a feature released with TMS Aurelius, which now has the global filter mechanism, allowing you to build multitenant applications.

But XData now includes a few nice mechanisms to integrate with such Aurelius filters that makes building multitenant servers very easily!

From a single handler for the event OnManagerCreate, you can enable the “Multitenant” filter for all requests:

  Manager.EnableFilter('Multitenant')
    .SetParam('tenantId', 'acme');

After you’ve enabled the “Multitenant” filter passing the proper id, you can use the Aurelius object manager as usual. But any request you do, like in the example, asking a list of products, will add the tenant filter.

Requests will not only apply global filters for queries, but also will enforce the filter in INSERT, UPDATE and DELETE operations.

Also building multi-database multitenant server will also be easy with the new TMultiTenantConnectionPool:

  FMultiPool := TMultiTenantConnectionPool.Create(
    TXDataHttpHeaderTenantResolver.Create('tenant-id'),
    TDBConnectionPoolFactory.Create
    );

The pool will automatically choose the correct database based on the HTTP header tenant-id – or any other criteria you might choose. All transparently.

Come See it Live!

Want to know more about XData? Want to see the new features live?

The free webinar “Introducing XData 5” will be held next Wednesday, March 31st, at 4pm UTC at the TMS Web Academy.

In this webinar, Wagner Landgraf, TMS XData architect, will explain to newcomers what TMS XData is about, how to use it, and then show all the new features in action, with real code.

And of course, it will be a live session: you can ask questions and participate! Register now for the “Introducing XData 5” webinar and learn more about this amazing REST API framework!

Read More

Read More

Workflow visualization and organization in FMX

Intro

The multi-device, true native app platform The FireMonkey® framework is the app development and runtime platform behind RAD Studio, Delphi and C++Builder. FireMonkey is designed for teams building multi-device, true native apps for Windows, OS X, Android and iOS, and getting them to app stores and enterprises fast.

source: https://www.embarcadero.com/products/rad-studio/fm-application-platform

FMX (FireMonkey) released in 2011 and shortly after we delivered a first set of components. Today, we want to show you the TTMSFNCKanbanBoard component, a highly configurable workflow visualization and organization component.

Features

Below is a list of the most important features the TTMSFNCKanbanBoard has to offer. The features are not limited to this list, but this will give you a quick insight on what we offer to be able to create an application that visualizes a workflow environment in FireMonkey.

  • Multi collapsible column support
  • Filtering and Sorting
  • Item autosizing
  • HTML formatted text support
  • Collapsible items
  • Database adapter
  • Drag & Drop support
  • Editing support
  • Fully customizable column & item appearance & custom Kanban board item drawing
  • Optional header & footer per column

Learn More!

Want to learn more about what the TTMSFNCKanbanBoard can do? Here is a video that highlights some of the above features through a demo application.

Download & Explore!

The TTMSFNCKanbanBoard component is part of the TMS FNC UI Pack, which, on top of FMX, also offers the ability to write your code once and target other frameworks (VCL, LCL and WEB). You can download a full featured trial version of the TMS FNC UI Pack and start exploring the capabilities of the TTMSFNCKanbanBoard component.

Coming up

The TTMSFNCKanbanBoard is the fourth of a series of components that is covered to empower your FMX (FireMonkey) developments. We started the series with a general overview of the most important components that we have to offer, followed by the TTMSFNCRichEditorTTMSFNCPlanner and the TTMSFNCTreeView. Next up will be the TTMSFNCGrid, a feature rich and powerful grid component.

Read More

Read More

Workflow visualization and organization in FMX

Intro

The multi-device, true native app platform The FireMonkey® framework is the app development and runtime platform behind RAD Studio, Delphi and C++Builder. FireMonkey is designed for teams building multi-device, true native apps for Windows, OS X, Android and iOS, and getting them to app stores and enterprises fast.

source: https://www.embarcadero.com/products/rad-studio/fm-application-platform

FMX (FireMonkey) released in 2011 and shortly after we delivered a first set of components. Today, we want to show you the TTMSFNCKanbanBoard component, a highly configurable workflow visualization and organization component.

Features

Below is a list of the most important features the TTMSFNCKanbanBoard has to offer. The features are not limited to this list, but this will give you a quick insight on what we offer to be able to create an application that visualizes a workflow environment in FireMonkey.

  • Multi collapsible column support
  • Filtering and Sorting
  • Item autosizing
  • HTML formatted text support
  • Collapsible items
  • Database adapter
  • Drag & Drop support
  • Editing support
  • Fully customizable column & item appearance & custom Kanban board item drawing
  • Optional header & footer per column

Learn More!

Want to learn more about what the TTMSFNCKanbanBoard can do? Here is a video that highlights some of the above features through a demo application.

Download & Explore!

The TTMSFNCKanbanBoard component is part of the TMS FNC UI Pack, which, on top of FMX, also offers the ability to write your code once and target other frameworks (VCL, LCL and WEB). You can download a full featured trial version of the TMS FNC UI Pack and start exploring the capabilities of the TTMSFNCKanbanBoard component.

Coming up

The TTMSFNCKanbanBoard is the fourth of a series of components that is covered to empower your FMX (FireMonkey) developments. We started the series with a general overview of the most important components that we have to offer, followed by the TTMSFNCRichEditorTTMSFNCPlanner and the TTMSFNCTreeView. Next up will be the TTMSFNCGrid, a feature rich and powerful grid component.

Read More

Read More

REST API Server with Delphi and XData 5: Read and Watch

TMS XData 5 has been released with lots of new features!

Photo by Glenn Carstens-Peters on Unsplash

In addition to the recent release of TMS Aurelius 5, a new major version of TMS XData has been also released.

TMS XData 5 is the fifth major version of our framework to build multitier applications, including REST API server, and interface-based API client. It makes it easy to build server-side services that reach a broad range of clients, including browsers and mobile devices.

Among several features, TMS XData provides:

  • Automatic serialization/deserialization of pure Delphi objects, primitive types, method parameters;
  • Authentication and Authorization;
  • Powerful routing mechanism: route endpoints to methods in your code;
  • Automatic, zero-code Swagger/SwaggerUI support;
  • Interface-based client allows type-safe client applications without additional code;
  • Smooth TMS Aurelius integration allows CRUD endpoints of database entities automatically.

The new features released with XData 5 were also antecipated in a previous blog post,

The what’s new section in the documentation provides you with a full list, but here we will list a few:

Attribute-based Authorization

Developers will be able to just add authorization attributes to methods (service operations) or entities (automatic CRUD endpoints) and everything will be applied accordingly. Fine-tuning the protection of your REST API will never be as simple.

  [Authorize]
  IDocumentService = interface(IInvokable)
    procedure Insert(Value: TDoc);

    [AuthorizeScopes('user, editor')]
    procedure Modify(Value: TDoc);

    [AuthorizeScopes('admin')]
    procedure Delete(DocId: string);

    [AuthorizeClaims('email')]
    procedure Approve(DocId: string);
  end;

In the example above, all methods (endpoints) require authentication, because the interface has an Authorize attribute that propagates to all methods. So, to invoke Insert, user must be authenticated. Still, to invoke Modify, the user must be authenticated and have either user or editor scope in its credentials. He must be admin to invoke Delete, and finally to approve a document, user must have an email in its claims.

It’s also worth noting that the same strategy applies to entities that generate automatic CRUD endpoints:

  [Entity, Automapping]
  [EntityAuthorize]
  [EntityAuthorizeScopes('editor', [TEntitySetPermission.Modify, TEntitySetPermission.Insert])]
  [EntityAuthorizeScopes('admin', [TEntitySetPermission.Delete])]
  TCustomer = class
  {...}
  public
    property Id: Integer read FId write FId;
    property Name: string read FName write FName;
  end;

To access customer endpoints, user must be authenticated. But he must have editor privileges to modify and insert (PUT and POST) and must be admin to invoke DELETE. Easy and straightforward.

Async/Await Support in Web Applications

TMS XData is smoothly integrated with TMS Web Core, the TMS framework to build web applications.

Now your can use async/await mechanism in TXDataWebClient methods that invoke XData server endpoints. As an example, invoking a XData REST API endpoint asynchronously will be as easy as doing this:

PendingOrders := await(XClient.List<TOrder>('$filter=Status eq pending'));
if PendingOrders.Count = 0 then
  Exit; // no pending orders to process

The single line above will build the HTTP request with proper URL endpoint and HTTP method, invoke it, deserialize the returned JSON into a list of TOrder objects, and all asynchronously! The await function will guarantee that the next line will be executed only after the async execution is executed. Can’t get easier than that.

Multitenant Servers

This is a feature released with TMS Aurelius, which now has the global filter mechanism, allowing you to build multitenant applications.

But XData now includes a few nice mechanisms to integrate with such Aurelius filters that makes building multitenant servers very easily!

From a single handler for the event OnManagerCreate, you can enable the “Multitenant” filter for all requests:

  Manager.EnableFilter('Multitenant')
    .SetParam('tenantId', 'acme');

After you’ve enabled the “Multitenant” filter passing the proper id, you can use the Aurelius object manager as usual. But any request you do, like in the example, asking a list of products, will add the tenant filter.

Requests will not only apply global filters for queries, but also will enforce the filter in INSERT, UPDATE and DELETE operations.

Also building multi-database multitenant server will also be easy with the new TMultiTenantConnectionPool:

  FMultiPool := TMultiTenantConnectionPool.Create(
    TXDataHttpHeaderTenantResolver.Create('tenant-id'),
    TDBConnectionPoolFactory.Create
    );

The pool will automatically choose the correct database based on the HTTP header tenant-id – or any other criteria you might choose. All transparently.

Come See it Live!

Want to know more about XData? Want to see the new features live?

The free webinar “Introducing XData 5” will be held next Wednesday, March 31st, at 4pm UTC at the TMS Web Academy.

In this webinar, Wagner Landgraf, TMS XData architect, will explain to newcomers what TMS XData is about, how to use it, and then show all the new features in action, with real code.

And of course, it will be a live session: you can ask questions and participate! Register now for the “Introducing XData 5” webinar and learn more about this amazing REST API framework!

Read More

Read More

Workflow visualization and organisation in FMX

Intro

The multi-device, true native app platform The FireMonkey® framework is the app development and runtime platform behind RAD Studio, Delphi and C++Builder. FireMonkey is designed for teams building multi-device, true native apps for Windows, OS X, Android and iOS, and getting them to app stores and enterprises fast.

source: https://www.embarcadero.com/products/rad-studio/fm-application-platform

FMX (FireMonkey) released in 2011 and shortly after we delivered a first set of components. Today, we want to show you the TTMSFNCKanbanBoard component, a highly configurable workflow visualization and organisation component.

Features

Below is a list of the most important features the TTMSFNCKanbanBoard has to offer. The features are not limited to this list, but this will give you a quick insight on what we offer to be able to create an application that visualizes a workflow environment in FireMonkey.

  • Multi collapsible column support
  • Filtering and Sorting
  • Item autosizing
  • HTML formatted text support
  • Collapsible items
  • Database adapter
  • Drag & Drop support
  • Editing support
  • Fully customizable column & item appearance & custom Kanban board item drawing
  • Optional header & footer per column

Learn More!

Want to learn more about what the TTMSFNCKanbanBoard can do? Here is a video that highlights some of the above features through a demo application.

Download & Explore!

The TTMSFNCKanbanBoard component is part of the TMS FNC UI Pack, which, on top of FMX, also offers the ability to write your code once and target other frameworks (VCL, LCL and WEB). You can download a full featured trial version of the TMS FNC UI Pack and start exploring the capabilities of the TTMSFNCKanbanBoard component.

Coming up

The TTMSFNCKanbanBoard is the fourth of a series of components that is covered to empower your FMX (FireMonkey) developments. We started the series with a general overview of the most important components that we have to offer, followed by the TTMSFNCRichEditorTTMSFNCPlanner and the TTMSFNCTreeView. Next up will be the TTMSFNCGrid, a feature rich and powerful grid component.

Read More

Read More