Recent

Author Topic: TurboPower Visual Planit Lazarus port version 1.04 released  (Read 37268 times)

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #30 on: August 30, 2016, 02:07:56 pm »
That's the mORMot !
It implements a server state flag and a table state flag to track changes.
And, with the mORMot, all implementation details are abstracted away from the user.

State is implemented only in the server? And REST principles?!

My server is an Indy HTTP REST server & I don't have that state functionality built-in to enable tracking real-time updates. One more reason to give mORMot another look. The only problem is I like writing my queries, triggers etc myself so I know what is going on & having to rewrite all my data classes so that they descend from TSQLRecord is making me drag my feet.  %)
« Last Edit: August 30, 2016, 02:43:52 pm by JD »
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #31 on: August 31, 2016, 08:36:23 pm »
First version of mORMot datasource for TvPlanit ready !

Source :
https://github.com/LongDirtyAnimAlf/mORMotTvPlanit

Ready made binaries for Windows:
https://github.com/LongDirtyAnimAlf/mORMotTvPlanit/releases/tag/1.0

Screen capture of running demos:
https://github.com/LongDirtyAnimAlf/mORMotTvPlanit/releases/download/1.0/bandicam.2016-08-31.20-21-52-707.mp4

For the ease of use, the mORMot source is included.
But mORMot itself can be found here:
http://synopse.info/fossil/wiki?name=SQLite3+Framework
mORMot source on GitHub:
https://github.com/synopse/mORMot


Greetings.

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #32 on: September 01, 2016, 07:55:35 am »
@DonAlfredo

Great! Thanks.
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #33 on: September 01, 2016, 01:22:00 pm »
Thank you, DonAlfredo. Great addition.

I already added your modified vpdata to svn and defined "WITHRTTI" in the package options.

Then I removed my installed tvplanit to avoid any conflicts with your run-time-only version and directory structure. Trying to compile the VpServer, however, ended with this error

Quote
Compile Project, Target: VpRESTserver.exe: Exit code 1, Errors: 5, Warnings: 229, Hints: 1294
VpRESTserver.lpr(41,1) Error: Can't open object file: fpc-win32\eccwin32O2.o
VpRESTserver.lpr(41,1) Error: Can't open object file: fpc-win32\sqlite3.o
VpRESTserver.lpr(41,1) Error: Can't open object file: fpc-win32\libkernel32.a
VpRESTserver.lpr(41,1) Error: Can't open object file: fpc-win32\libgcc.a
VpRESTserver.lpr(41,1) Error: Can't open object file: fpc-win32\libmsvcrt.a

Is there anything missing? For inclusion of additions to tvplanit I want everything to compile with standard Laz-trunk, Laz1.6 and Laz1.4.4, and fpc-trunk, fpc3.0 and fpc2.6.4.

Initially I had thought to restructure your folders such that vpmormotds.pas would be in "source/addons/mormot", but since mORMot cannot be precompiled into a package it would not be possible as well for a "laz_visualplanit_mormot" package, and the user would be forced to specify the path to vpmormotds in the searchpath. Your version, however, is compact and has everything it its correct place. Therefore I will leave your example alone and just copy the "mormot" folder to "examples". I will skip the fulldemo, though, and refer the user to your site. And I will also skip the mORMot sources since I don't want to distribute them along with tvplanit - but I guess you already planned that because you named that folder "mORMotSourceHere".

And could you write a short readme for the example/mormot folder telling the user to compile both server and client projects and to start the server first? What happens if the client is started without the server?

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #34 on: September 01, 2016, 01:53:14 pm »
Well, the mORMot needs some attention before running. The docs can help.

For FPC, some details are here:
http://synopse.info/files/html/Synopse%20mORMot%20Framework%20SAD%201.18.html#TITL_113

mORMot needs SQLite3.
Plain mORMot sources come with static binding of SQLite3 enabled.
So, users need the static SQLite3 object files (and some more) to get things running.
Pre-compiled files can be downloaded here:
http://synopse.info/files/sqlite3fpc.7z
Just put the four supplied directories with files in the root folder of your mORMot install.

The file synopse.inc can be used to switch features on and off.
Look for:
Code: Pascal  [Select][+][-]
  1. {$ifdef MSWINDOWS}
  2.   {$ifdef CPUX86}
  3.     {$define FPCSQLITE3STATIC} // we supply Win32 .obj
  4.   {$else}
  5.     {.$define FPCSQLITE3STATIC} // we supply Win64 .o trigger GPF
  6.   {$endif}
  7. {$endif}
  8.  

If you disable FPCSQLITE3STATIC, you do not need the object files, but you have to supply sqlite3.dll when running your app.

Surely, you should not add the mORMot sources into TvPlanit.
I will prepare a readme.

And I hope that you will add the full demo ... it looks very nice and works very well !!
Standalone as well as with the REST server !

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #35 on: September 01, 2016, 01:58:03 pm »
Additional info !

The great author of mORMot (Ab) has, on my request,  just added some extra features to the mORMot especially for TvPlanit.
Some more are (perhaps/pending) in the pipeline.
So, users of the mORMot datasource need (should use) latest sources of the mORMot !

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #36 on: September 01, 2016, 02:06:56 pm »
Which features?
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #37 on: September 01, 2016, 02:44:10 pm »
Additional info !

The great author of mORMot (Ab) has, on my request,  just added some extra features to the mORMot especially for TvPlanit.
Some more are (perhaps/pending) in the pipeline.
So, users of the mORMot datasource need (should use) latest sources of the mORMot !

That's good. Is this effective from today?

JD

Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #38 on: September 01, 2016, 03:11:25 pm »
@Thaddy:
Lookups on readonly datasets based on a SQL table.
Simulated (readonly !) delete is pending.

@JD:
This morning:
http://synopse.info/fossil/info/80838cee2cf2ebdf491471ed17e11acb56a43c8d

@JD2:
The mORMot restserver can use wrappers to generate code.
The newest restserver
( https://github.com/LongDirtyAnimAlf/mORMotTvPlanit/releases/download/1.0/VpRESTserver.exe )
will generate these wrappers. Just run the server and point your browser to:
http://localhost:888/root/wrapper
No need to type code anymore ... just copy/paste !

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #39 on: September 02, 2016, 09:44:49 am »
Another mORMot change from this morning allows GUI mORMot TvPlanit clients on Linux systems:
http://synopse.info/fossil/info/6f5e1c538559283d8ed142495f4b33a093f888e5
(successfully tested on RPi3)

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #40 on: September 02, 2016, 11:10:23 am »
It's good that a mORMOt newbie like me is testing this, otherwise non-experienced users will give up too early...

OK - here's what I did: got your new sources, again removed my laz_visualplanit package to avoid conflicts, downloaded the sqlite3 obj files into the examples/mormot/mORMotSourceHere (is is important to keep the parent folder, fpc-win32 in my case) and compiled the server. Error due to "ARM target not supported". Changed compilation target back to default. Compiles fine now, but then I got a runtime error "exception 'EHttpApiServer': HttpSetServiceConfiguration failed: access denied (5)".

What to do now?

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #41 on: September 02, 2016, 11:35:52 am »
I do not know what system you use to run the server, but on some you have to elevate to administrator.
(you are opening a privileged port)
Or use the (just added) register utility to register your server.

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #42 on: September 02, 2016, 02:48:15 pm »
Sorry. My system is Win10/64 bit, Laz-trunk 32 bit/fpc3.0.

Yes, the server starts with admin rights. But if I run it the next time as standard user it runs fine as well. Seems to be registered somewhere...

The SimpleDemo and mORMotFullDemo run fine now. Then I copied the mORMotDataStoreDS, the server files and the SimpleDemo to my tvplanit installation. Reinstalled tvplanit, added the requirement for laz_visualplanit to SimpleDemo (because I think this will be standard application), removed the tvplanit source from the SearchPath, recompiled --> Running fine.

All relevant files are now in the ccr repository. A user wanting to run the demo must download the mORMot sources and copy them to folder mORMotSourceHere, same with the sqlite3 obj files. We should mention the download sources in the readme file.

Currently I am testing with other Lazarus/FPC versions:

- Laz 1.6/fpc 3.0: Seems to work fine. Initially a got an error (I did not write down the exact words) indicating that the existing exe cannot be rewritten. It looks as if the server does not end when ENTER is pressed. But not 100% sure on this... After a restart this issue did not happen any more, so far.

- Laz 1.44/fpc 2.6.4 does not compile mORMot: "Identifier not found TRegisters" in SynCommons.crc32fast, line 30107 (maybe it can be bypassed by defining PUREPASCAL, but I did not check that). (*see below)

I will have to think about the fulldemo. Definitely I will not duplicate its code into a mORMot application, taking care of two programs which are 99.9% identical will end up in a mess. What could work would be to put the datastore into a run-time created datamodule; the standard fulldemo would have the TVpBufDSDatastore, the mORMot fulldemo the TVpmORMotDatastore in this datamodule. A define would decide which one of the datamodules would be linked in; the rest of the application would be the same. I'll still have to test that, though.

*[EDIT]
Laz144 or fpc 2.6.4 seem to lack a define CPUX86. After setting this manually, compilation passes this location, but finds another error in mORMot.pas, line 30868: "aSQLFrom := aSQLFrom+SQLTableName+' '+ToUTF8(aField[1]);" - "Can't determine which overloaded function to call (ToUTF8)".
« Last Edit: September 02, 2016, 03:17:44 pm by wp »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #43 on: September 02, 2016, 03:27:35 pm »
More changes available at GitHub:
https://github.com/LongDirtyAnimAlf/mORMotTvPlanit

Main changes:
added a daemon server to run in the background.
added port option for client (VpmORMotDS.pas).
added logging for client (VpmORMotDS.pas).

At this moment, a TvPlanit REST server daemon (Linux x86_64) is running at AWS. See settings in demomain.pas
Wrappers:
http://54.194.211.233:8888/root/wrapper

About fpc 2.6.4
I have never used this version. Started using FPC at 2.7.1.
So, I have never put effort in getting the mORMot run on 2.6.4.
And I think it will be hard to get it running on 2.6.4 ... mORMot needs recent FPC features I guess.

About the full demo.
I did not want to polute the original.
However, the BufDataSet datastore of the original can easily be replaced runtime by a mORMot datastore in the OnCreate of the form.

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: TurboPower Visual Planit Lazarus port version 1.04 released
« Reply #44 on: September 02, 2016, 03:55:56 pm »
@DonAlfredo

First of all, thanks a lot for your contributions. Here are my general observations

a) your mORMot distribution differs from the "official" distribution on Synopse website
b) yours seems to be more tailored for Lazarus/FreePascal (you have Lazarus projects already unlike the official which has Delphi projects by default)
c) yours has more content - stuff for domain driven design (DDD), more code files and twice as many samples as the official version (15 compared to 33)

I just did a directory comparison of the two distributions. I'm not complaining as yours works for me out of the box (apart from having to download sqlite3fpc.7z). I just wonder if you intend to keep your work in sync with the main distribution in the long run? That would suit me just fine.

EDIT: Looks like you renamed a lot of files too. In the SQLite3 folder, it looks like you changed tha names of files beginning with SQLite3XXXXX.pas to mORMotXXX.pas which makes the samples incompatible.

JD
« Last Edit: September 02, 2016, 04:08:45 pm by JD »
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

 

TinyPortal © 2005-2018