Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2019-06

Developing a mini ERP / web based development

16 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Darius Blaszyk

Hi all,

I have been asked to write a limited functionality / mini ERP type of software for an NGO that is setting up a hospital. I'm doing this in my own time and free of charge. The compiler and IDE of choice are of course FreePascal & Lazarus. I’m still thinking about the direction to go exactly with this and I was hoping to get some feedback/support from the community here as I always have gotten over the years.

The hardware of choice is already made and will be a network of several Chromebooks on which all staff will be logging in the system. This made me think that a desktop application is less feasible and I should look at a web-based solution. I found some frameworks such as ExtPascal, fano, Brook, pas2js. Unfortunately, I don't know much about web-based applications. So my question is whether any of the frameworks are mature enough to create a database driven application as described. Possibly there are other frameworks available that I don't know of but are worth investigating?

As I am starting this endeavor I would welcome any advisory or practical help. If someone is willing to support in any form, please contact me via PM.

TIA for all pointers, tips, and suggestions.

Regards, Darius

Reply by email

Michael Van Canneyt
to Darius Blaszyk
Darius Blaszyk wrote 13 lines
Hi all, I have been asked to write a limited functionality / mini ERP type of software for an NGO that is setting up a hospital. I'm doing this in my own time and free of charge. The compiler and IDE of choice are of course FreePascal & Lazarus. I’m still thinking about the direction to go exactly with this and I was hoping to get some feedback/support from the community here as I always have gotten over the years. The hardware of choice is already made and will be a network of several Chromebooks on which all staff will be logging in the system. This made me think that a desktop application is less feasible and I should look at a web-based solution. I found some frameworks such as ExtPascal, fano, Brook, pas2js. Unfortunately, I don't know much about web-based applications. So my question is whether any of the frameworks are mature enough to create a database driven application as described. Possibly there are other frameworks available that I don't know of but are worth investigating?

ExtPascal was a dead end and is now effectively dead (unless I am misinformed).

I can't inform you about fano.

As for the others:

Brook & Pas2js are definitely worth investigating.

Brook is a long-standing server platform for FPC.

pas2js is used as the basis for TMS Web Core (a commercial product for Delphi/lazarus. pas2js is meanwhile very mature. (I use it myself extensively :)) You must use this if you wish to include a lot of browser-side functionality.

If it is for charity, you could try getting a TMS Web core license for free. Programming then becomes like creating a desktop program; drag&drop.

For server-side database Access, there is sqldbRestBridge. It is fairly new, but is scheduled to be included in TMS WEB core.

You can also simply program using fcl-web: simple HTTP request/response. All the others are based on top of it, if I am correct.

If you use bare-bones fcl-web, it's a bit like PHP: you always generate the full HTML on the server.

Doubtlessly, there are other frameworks to work with. I work with the above ones (and developed 3 our of 4 :)) so I am of course giving a biased view...

Michael.

Reply by email

Marcos Douglas B. Santos
to Darius Blaszyk: I have been asked to write a limited functionality / mini ERP type of software for an NGO…
PM Darius Blaszyk wrote 10 lines
Hi all, I have been asked to write a limited functionality / mini ERP type of software for an NGO that is setting up a hospital. I'm doing this in my own time and free of charge. The compiler and IDE of choice are of course FreePascal & Lazarus. I’m still thinking about the direction to go exactly with this and I was hoping to get some feedback/support from the community here as I always have gotten over the years. The hardware of choice is already made and will be a network of several Chromebooks on which all staff will be logging in the system. This made me think that a desktop application is less feasible and I should look at a web-based solution. I found some frameworks such as ExtPascal, fano, Brook, pas2js. Unfortunately, I don't know much about web-based applications. So my question is whether any of the frameworks are mature enough to create a database driven application as described. Possibly there are other frameworks available that I don't know of but are worth investigating? As I am starting this endeavor I would welcome any advisory or practical help. If someone is willing to support in any form, please contact me via PM. TIA for all pointers, tips, and suggestions.

Hello,

You can use fpWeb, which came with FPC.
I'm not sure if fpWeb documentation is updated and you need to pay attention on it.
I'm saying that because the original ones uses DataModule + Actions, like old Delphi WebBroker.
But you can use all new features of fpWeb, eg. Routes, instead of this old WebBroker model.

I've wrote two simple articles about it, however written in Portuguese: https://objectpascalprogramming.com/fpweb
https://objectpascalprogramming.com/fpweb-hello

I believe you can use Google Translator, though.

best regards,
Marcos Douglas

Reply by email

Darius Blaszyk
to Michael Van Canneyt: ExtPascal was a dead end and is now effectively dead (unless I am misinformed). I can't…

Thank you for the suggestions and tips.

I can't inform you about fano.

I sent out a mail to the developer. Let's see what comes back. I think he is also on this list. The demo fano-app did only crash here, see below:

Exception class : *ERouteHandlerNotFound*
Message : *Route not found. Method: GET Uri: /cgi-bin/app.cgi*

Brook is a long-standing server platform for FPC.

Will have look at this tomorrow.

Show quoted text 6 lines
pas2js is used as the basis for TMS Web Core (a commercial product for Delphi/lazarus. pas2js is meanwhile very mature. (I use it myself extensively :)) You must use this if you wish to include a lot of browser-side functionality.

What do you mean, jQuery for instance? I have been trying to get pas2js running today, but I was unsuccefull until now. All I get are empty (or near empty) pages. I installed version 1.4.8 and setup the PATH env variable to the bin folder. Compiling the demo's did result in the following error:

webcompiler/demowebcompiler.lpr(6,27) Error: can't find unit "webfilecache" Fatal: Compilation aborted
make: *** [Makefile:36: demowebcompiler] Error 6

The demo's that were compiled, I tried to open locally and from the cgi-bin folder, but no succes. For instance the demobar example only shows:

TChartJS Create bar charts using Pas2JS & ChartJS (view source <demobar.lpr> )

Also the nodejs hello world example mentioned on the wiki crashes. I have no idea what goes wrong or how to debug.

$ pas2js -Tnodejs hello.pas
Pas2JS Compiler version 1.4.8 [2019/06/24] for Linux x86_64 Copyright (c) 2018 Free Pascal team.
Info: 5313 lines in 6 files compiled, 0.1 secs
$ nodejs hello.js
/hello.js:1
(function (exports, require, module, __filename, __dirname) { <script type="application/javascript">
^

SyntaxError: Unexpected token <
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19)

If it is for charity, you could try getting a TMS Web core license for free.

Programming then becomes like creating a desktop program; drag&drop.

I will try and contact them. Thanks again for the tip.

Darius

Reply by email

Darius Blaszyk
to Marcos Douglas B. Santos: You can use fpWeb, which came with FPC. I'm not sure if fpWeb documentation is updated…
You can use fpWeb, which came with FPC.

Great, is there any database master/detail example that I could use to learn? I have no idea yet how to program the visuals for such an application. Any tips would be greatly appreciated!

Show quoted text 6 lines
I've wrote two simple articles about it, however written in Portuguese: https://objectpascalprogramming.com/fpweb https://objectpascalprogramming.com/fpweb-hello I believe you can use Google Translator, though.

No problem! I read them both. They were very interesting.

Darius

Reply by email

Michael Van Canneyt
to Darius Blaszyk: Thank you for the suggestions and tips. I sent out a mail to the developer. Let's see…
Darius Blaszyk wrote 9 lines
> pas2js is used as the basis for TMS Web Core (a commercial product for > Delphi/lazarus. pas2js is meanwhile very mature. (I use it myself > extensively :)) > You must use this if you wish to include a lot of browser-side > functionality. > What do you mean, jQuery for instance? I have been trying to get pas2js running today, but I was unsuccefull until now. All I get are empty (or near empty) pages.

That is correct. For many demos, the results are shown in the browser's developer console.

Show quoted text 7 lines
I installed version 1.4.8 and setup the PATH env variable to the bin folder. Compiling the demo's did result in the following error: webcompiler/demowebcompiler.lpr(6,27) Error: can't find unit "webfilecache" Fatal: Compilation aborted make: *** [Makefile:36: demowebcompiler] Error 6

I tested, it compiles with pas2js trunk. We'll need to check the 1.4.8 installer.

Show quoted text 6 lines
The demo's that were compiled, I tried to open locally and from the cgi-bin folder, but no succes. For instance the demobar example only shows: TChartJS Create bar charts using Pas2JS & ChartJS (view source <demobar.lpr> )

It works here. What do you see in the debug console ?

Also the nodejs hello world example mentioned on the wiki crashes. I have no idea what goes wrong or how to debug.

I guess that you'll first need to acquaint yourself with web programming before attempting to use pas2js, and in particular how to debug using the browser. Even if you use TMS Web Compiler, that is a must.

Michael.

Reply by email

Marcos Douglas B. Santos
to Darius Blaszyk: Great, is there any database master/detail example that I could use to learn? I have no…
PM Darius Blaszyk wrote 6 lines
> > You can use fpWeb, which came with FPC. Great, is there any database master/detail example that I could use to learn? I have no idea yet how to program the visuals for such an application. Any tips would be greatly appreciated!

fpWeb will be used in backend.
For the frontend you need to use HTML+CSS+JavaScript.

You can use pas2js, coding in Object Pascal, but generating JavaScript for create views on the browser, as already mentioned. However, I don't work much in front so, I don't have examples for you, sorry.

att,
Marcos Douglas

Reply by email

Michael Van Canneyt
to Michael Van Canneyt: That is correct. For many demos, the results are shown in the browser's developer console.
Michael Van Canneyt wrote 8 lines
> The demo's that were compiled, I tried to open locally and from the cgi-bin > folder, but no succes. For instance the demobar example only shows: > > TChartJS Create bar charts using Pas2JS & ChartJS (view source <demobar.lpr> > ) It works here. What do you see in the debug console ?

I checked this. The demos work correct if you compile in lazarus. I fixed the makefile so they also work correct if you compile using make.

Michael.

Reply by email

Zamrony P. Juhara
to Michael Van Canneyt: ExtPascal was a dead end and is now effectively dead (unless I am misinformed). I can't…

Hi Darius,
I am author of Fano Framework. I encourage people to try Fano Framework, but as of now, I would not advise you to use it on production setup. While many of web framework features are already built, they have not been tested on production. The error

Exception class : ERouteHandlerNotFoundMessage : Route not found. Method: GET Uri: /cgi-bin/app.cgi actually tells that application is working as intended. If you use example application https://github.com/fanoframework/fano-app 
then routes that can be accessed is defined in
https://github.com/fanoframework/fano-app/blob/master/app/Routes/routes.inc

So you will be able to access application through following urls http://[hostname]/ (GET)
http://[hostname]/hello/{name} (GET/POST)
http://[hostname]/hello/{name}/json (GET/POST) => output is JSON for example http://[hostname]/hello/darius http://[hostname]/hi/{name} (POST)

Zamrony P. Juhara
Website:
http://v3.juhara.com
Blog:
http://zamronyp.juhara.com
http://delphindo.wordpress.com (kontributor)

Github:
https://github.com/zamronypj

Stackoverflow:
http://stackoverflow.com/users/5855039/zamrony-p-juhara

Google Play Store:
http://goo.gl/gCs4Bc

On Friday, June 28, 2019, 12:29:32 AM GMT+8, Michael Van Canneyt wrote:

Darius Blaszyk wrote 13 lines
Hi all, I have been asked to write a limited functionality / mini ERP type of software for an NGO that is setting up a hospital. I'm doing this in my own time and free of charge. The compiler and IDE of choice are of course FreePascal & Lazarus. I’m still thinking about the direction to go exactly with this and I was hoping to get some feedback/support from the community here as I always have gotten over the years. The hardware of choice is already made and will be a network of several Chromebooks on which all staff will be logging in the system.  This made me think that a desktop application is less feasible and I should look at a web-based solution.  I found some frameworks such as ExtPascal, fano, Brook, pas2js.  Unfortunately, I don't know much about web-based applications.  So my question is whether any of the frameworks are mature enough to create a database driven application as described.  Possibly there are other frameworks available that I don't know of but are worth investigating?

ExtPascal was a dead end and is now effectively dead (unless I am misinformed).

I can't inform you about fano.

As for the others:

Brook & Pas2js are definitely worth investigating.

Brook is a long-standing server platform for FPC.

pas2js is used as the basis for TMS Web Core (a commercial product for Delphi/lazarus. pas2js is meanwhile very mature. (I use it myself extensively :)) You must use this if you wish to include a lot of browser-side functionality.

If it is for charity, you could try getting a TMS Web core license for free. Programming then becomes like creating a desktop program; drag&drop.

For server-side database Access, there is sqldbRestBridge. It is fairly new, but is scheduled to be included in TMS WEB core.

You can also simply program using fcl-web: simple HTTP request/response. All the others are based on top of it, if I am correct.

If you use bare-bones fcl-web, it's a bit like PHP: you always generate the full HTML on the server.

Doubtlessly, there are other frameworks to work with. I work with the above ones (and developed 3 our of 4 :)) so I am of course giving a biased view...

Michael._______________________________________________ fpc-pascal maillist  - 
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Zamrony P. Juhara
to Zamrony P. Juhara

Live example of https://github.com/fanoframework/fano-app when deploy and setup correctly with web server can be access here https://fano.juhara.id/ So you will be able to access for example
https://fano.juhara.id/hello/darius or https://fano.juhara.id/hello/darius/json (JSON output)

Unless you sent POST request, you will get exception EMethodNotAllowed if you try to browse to https://fano.juhara.id/hi/darius because route for hi/{name} only defined for POST request.

Zamrony P. Juhara
Website:
http://v3.juhara.com
Blog:
http://zamronyp.juhara.com
http://delphindo.wordpress.com (kontributor)

Github:
https://github.com/zamronypj

Stackoverflow:
http://stackoverflow.com/users/5855039/zamrony-p-juhara

Google Play Store:
http://goo.gl/gCs4Bc

On Saturday, June 29, 2019, 10:31:33 AM GMT+8, Zamrony P. Juhara via fpc-pascal wrote:

Hi Darius,
I am author of Fano Framework. I encourage people to try Fano Framework, but as of now, I would not advise you to use it on production setup. While many of web framework features are already built, they have not been tested on production. The error

Exception class : ERouteHandlerNotFoundMessage : Route not found. Method: GET Uri: /cgi-bin/app.cgi actually tells that application is working as intended. If you use example application https://github.com/fanoframework/fano-app 
then routes that can be accessed is defined in
https://github.com/fanoframework/fano-app/blob/master/app/Routes/routes.inc

So you will be able to access application through following urls http://[hostname]/ (GET)
http://[hostname]/hello/{name} (GET/POST)
http://[hostname]/hello/{name}/json (GET/POST) => output is JSON for example http://[hostname]/hello/darius http://[hostname]/hi/{name} (POST)

Zamrony P. Juhara
Website:
http://v3.juhara.com
Blog:
http://zamronyp.juhara.com
http://delphindo.wordpress.com (kontributor)

Github:
https://github.com/zamronypj

Stackoverflow:
http://stackoverflow.com/users/5855039/zamrony-p-juhara

Google Play Store:
http://goo.gl/gCs4Bc

On Friday, June 28, 2019, 12:29:32 AM GMT+8, Michael Van Canneyt wrote:

Darius Blaszyk wrote 13 lines
Hi all, I have been asked to write a limited functionality / mini ERP type of software for an NGO that is setting up a hospital. I'm doing this in my own time and free of charge. The compiler and IDE of choice are of course FreePascal & Lazarus. I’m still thinking about the direction to go exactly with this and I was hoping to get some feedback/support from the community here as I always have gotten over the years. The hardware of choice is already made and will be a network of several Chromebooks on which all staff will be logging in the system.  This made me think that a desktop application is less feasible and I should look at a web-based solution.  I found some frameworks such as ExtPascal, fano, Brook, pas2js.  Unfortunately, I don't know much about web-based applications.  So my question is whether any of the frameworks are mature enough to create a database driven application as described.  Possibly there are other frameworks available that I don't know of but are worth investigating?

ExtPascal was a dead end and is now effectively dead (unless I am misinformed).

I can't inform you about fano.

As for the others:

Brook & Pas2js are definitely worth investigating.

Brook is a long-standing server platform for FPC.

pas2js is used as the basis for TMS Web Core (a commercial product for Delphi/lazarus. pas2js is meanwhile very mature. (I use it myself extensively :)) You must use this if you wish to include a lot of browser-side functionality.

If it is for charity, you could try getting a TMS Web core license for free. Programming then becomes like creating a desktop program; drag&drop.

For server-side database Access, there is sqldbRestBridge. It is fairly new, but is scheduled to be included in TMS WEB core.

You can also simply program using fcl-web: simple HTTP request/response. All the others are based on top of it, if I am correct.

If you use bare-bones fcl-web, it's a bit like PHP: you always generate the full HTML on the server.

Doubtlessly, there are other frameworks to work with. I work with the above ones (and developed 3 our of 4 :)) so I am of course giving a biased view...

Michael._______________________________________________ fpc-pascal maillist  - 
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

silvioprog
to Darius Blaszyk: I have been asked to write a limited functionality / mini ERP type of software for an NGO…

Hi Darius.

PM Darius Blaszyk wrote 9 lines
Hi all, I have been asked to write a limited functionality / mini ERP type of software for an NGO that is setting up a hospital. I'm doing this in my own time and free of charge. The compiler and IDE of choice are of course FreePascal & Lazarus. I’m still thinking about the direction to go exactly with this and I was hoping to get some feedback/support from the community here as I always have gotten over the years.

First of all, good luck in your project! :-)

The hardware of choice is already made and will be a network of several

Show quoted text 8 lines
Chromebooks on which all staff will be logging in the system. This made me think that a desktop application is less feasible and I should look at a web-based solution. I found some frameworks such as ExtPascal, fano, Brook, pas2js. Unfortunately, I don't know much about web-based applications. So my question is whether any of the frameworks are mature enough to create a database driven application as described. Possibly there are other frameworks available that I don't know of but are worth investigating?

There is an important project also for web/database purposes missing on the above list: mORMot. You should consider to investigate it too. :-)

Regarding Brook, there are two active versions of it:

1. https://github.com/risoflora/brookframework
2. https://github.com/risoflora/brookfreepascal

Let me explain starting from option 2, BrookFreePascal, which I'm going to reference as B4F. As Michael commented (thanks dude! :-)), it is a long-standing FCL-based project, providing high-level features making it easy to develop FPC/Laz web applications. It was strong influenced by Slim Framework, also active nowadays and, like Slim, B4F uses a basic routing concept, which triggers predefined methods named as the same HTTP verbs, like Get, Post, Delete etc., declared in the public scope of an action class. The few lines below illustrates it:

...
  THello = class(TBrookAction)
  public
    procedure Get; override;
  end;
procedure THello.Get;
begin
  Write('Hello Darius. I'm Brook on the Chromebook! :-)');
end;
initialization
  THello.Register('/hello');
...

If you run a Brook application containing these lines above, just navigate to "/hello" to get the message "Hello Darius. I'm Brook on the Chromebook! :-)" on your web browser and have a lot of fun.

Now, I'm going to explain the option 1 a bit, the new Brook Framework, under active development, projected for Free Pascal and Delphi, which will be referenced in next lines as BF. It was entirely written from scratch with special care for embedded systems. BF routing was and is still inspired by projects like Express, Flask, Laravel, and its components follows some RAD concepts adopted by DataSnap/fpWeb. For example, if you have a console or VCL project, you can turn it into a web server application: at design time, just drag-drop three components ( BrookLibraryLoader1, BrookHTTPServer1 and BrookHTTPRouter1) to a form or data module, define a regular expression pattern for a route item and implement its request event:

... [.lfm or .dfm]

  object BrookHTTPRouter1: TBrookHTTPRouter
    Routes = <
      item
        Pattern = '/hello/(?P<name>[a-zA-Z]+)'
        OnRequest = BrookHTTPRouter1Routes0Request
      end>
  end

... [.pas]

procedure TForm1.BrookHTTPRouter1Routes0Request(ASender: TObject;
  ARoute: TBrookHTTPRoute; ARequest: TBrookHTTPRequest;
  AResponse: TBrookHTTPResponse);
begin
  AResponse.SendFmt('Hello %s', [ARoute.Variables['name']], 'text/html',
200);
end;

...

This way, if you navigate to "/hello/Darius", the message "Hello Darius" will be displayed on the browser, however, any other invalid value, like " /hello/*123*", will be automatically refused, due to pattern " /hello/(?P<name>[a-zA-Z]+)" defined to the route item.

There are a lot of features (three threading models, data compression, on-demand content, JIT optimizations, etc.) with focus on performance that I couldn't detail in a single message, but the most important info: BF loads a GNU C library which provides a low-level API containing common HTTP features that are a good replacement for HTTP servers like Apache, Nginx, NodeJS, Civetweb and so on. In short, you can run your application in production and provide web services in the same (or higher) performance as those servers, just distributing a small single-file library with your executable, that probably will already be using other library, like the database client one, for example.

As I am starting this endeavor I would welcome any advisory or practical

Show quoted text 6 lines
help. If someone is willing to support in any form, please contact me via PM. TIA for all pointers, tips, and suggestions. Regards, Darius

I'd like to make a naive suggestion for you regarding to server side. You mentioned about several Chromebooks logging to the system. So, beforehand, what do you think about simulating that scenario? It is a little bit easy to do: there are tools like wrk, JMeter, ApacheBench etc. you could use to trigger several requests generating reports by itself like those ones <https://github.com/risoflora/libsagui/tree/master/examples/benchmark>. IMHO, it could be a reasonable way to choose the proper package/server to serve your requirements.

Silvio Clécio

Reply by email

Graeme Geldenhuys
to silvioprog

Hi,

Does FPC support annotations yet?

So in the future (or hopefully now), we could create something like what many Java frameworks allow. Simply annotate a plain class to do the magic for you - a massive reduction in boilerplate code. So we could end up with a RESTful resource/controller as follows:

@Path('/troopers')
@Produces('application/json')
TStormtrooperResource = class(TObject)

  public
    @Path('/{id}')
    @GET
    function GetStormtrooper(@PathParam('id') id: string): TStormtrooper;
    @POST
    function CreateTrooper(trooper: TStormTrooper): TStormtrooper;
end;
function TStormTrooperResource.GetStromtrooper(const id: string):
TStormtrooper;
begin
  result := SomeDataAccessLayer.GetStormtrooper(id);
end;
function TStormTrooperResource.CreateTrooper(trooper: TStormTrooper):
TStormtrooper;
begin
  result := SomeDataAccessLayer.AddTrooper(trooper);
end;

So with a web browser or rest client, if you visit the endpoint '/troopers/7' it will return a TStormtrooper object serialized as JSON output. And also a POST to the endpoint '/troopers' will add a Stormtrooper to your database.

If you wanted XML instead of JSON, simply changes the @Produces annotation.

silvioprog wrote 20 lines
class. The few lines below illustrates it: ... THello = class(TBrookAction) public procedure Get; override; end; procedure THello.Get; begin Write('Hello Darius. I'm Brook on the Chromebook! :-)'); end; initialization THello.Register('/hello'); ... If you run a Brook application containing these lines above, just navigate to "/hello" to get the message "Hello Darius. I'm Brook on the Chromebook! :-)" on your web browser and have a lot of fun.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Sven Barth
to Graeme Geldenhuys

Graeme Geldenhuys schrieb am So., 7. Juli
2019, 11:45:

Does FPC support annotations yet?

In the Object Pascal world they are called custom attributes, are accessible through the RTTI and their syntax is [AttributeName(Arguments)]. There exists a branch with them and it's "just" a matter of integrating them into trunk.

Regards,
Sven

Reply by email

Graeme Geldenhuys
to Sven Barth
Sven Barth wrote
There exists a branch with them and it's "just" a matter of integrating them into trunk.

Nice, that will be a real game changer! Thanks for the info Sven.

Regards,
Graeme

Reply by email

Michael Van Canneyt
to Sven Barth: Graeme Geldenhuys schrieb am So., 7. Juli 2019, 11:45: In the Object Pascal world they…
Sven Barth wrote 10 lines
Graeme Geldenhuys schrieb am So., 7. Juli 2019, 11:45: > Does FPC support annotations yet? > In the Object Pascal world they are called custom attributes, are accessible through the RTTI and their syntax is [AttributeName(Arguments)]. There exists a branch with them and it's "just" a matter of integrating them into trunk.

I am glad you decided to put quotes around the "just" :-)

Michael.

Reply by email

Jean SUZINEAU
to Zamrony P. Juhara: Live example of https://github.com/fanoframework/fano-app when deploy and setup…

Hello,

I have a big bunch of freepascal code under lgpl, with little documentation and a lot of identifiers in French, I hesitated a long time before sending this message,  ;-) , but may be it could be useful for you.
From 2002 to 2017 I've been developing functionalities for printing documents in an ERP for the building industry. The code was first written in Delphi 7 and around 2011 I proposed to my boss to translate the code to freepascal for free and in exchange move under LGPL the code that is not specific to the ERP (the main part of the ERP is written under 4js Genero https://4js.com/ with servers running linux most of the time).
It's mainly an ORM, lines of database tables are read through a TDataset and placed in objects. You get an object for each line of table. And I've written the equivalent components of data controls such as TDBEdit that connect directly to this line  object (TChamp_Edit from unit ucChamp_Edit, package OD_DelphiReportEngine_Controls in that case). For printing, after using QuickReport, Rave Reports in Delphi, I choosed around 2004 to write my own reporting engine to generate Open Office documents. The first versions were using OpenOffice through COM bridge, but current version generates directly OpenDocument odt files from template ott files.
I use the same design pattern for each database table involved, so very quickly I wrote a source code generator based on templates, at first as plugin for ModelMaker under Delphi, then moved to plugin for Star UML, and currently it's a standalone program which uses a TDataset to get the list of fields of a database table and the type of each field. Most of the time I use it to generate pascal files for my ORM, but you can generate whatever kind of file you need (SQL, C#, PHP, Angular...) for your own design pattern.

For the user interface, at first it was a classic Windows program using Delphi forms running on the client computer, but around 2014 I needed to move my code to the server in web development paradigm. I'm dreaming of a Lazarus able to compile forms to webasm.
For now I use Google Angular ( https://angular.io/ ), the typescript language it's based upon has been cocreated by Anders Hejlsberg, father of Turbo Pascal and Delphi.
Currently I scratch my head, deep meditation, to write for pas2js the equivalent of my TChamp_xxx components, using Pas2JS_Widget from heliosroots. It shoudn't be too much complicated.

My repository is at :
https://github.com/jsuzineau/pascal_o_r_mapping
the most current code is on branch TjsDataContexte (I keep the master branch for compatibility with the ERP, a slightly older code). Most recent release of the code generator:
https://github.com/jsuzineau/pascal_o_r_mapping/releases/tag/2019_03_30_Generateur_de_code corresponding source code in
https://github.com/jsuzineau/pascal_o_r_mapping/tree/master/tools/Generateur

My unit testing project is in subdirectory fpcunit/fuPASCAL_O_R_MAPPING, mainly used to test OpenDocument generation.
My main example is the project jsWorks in subdirectory jsWorks. I use it to record and log my working sessions, it serves as a basis for billing my hours of work.
It's a desktop application that I compile and use under linux and Windows. It's also accessible from a browser through http with a small frontend coded in Angular (button Http on the main form of the desktop application). The biggest part of the frontend is a skeleton created by the code generator, with a small customized part to test html input with TinyMCE (a few html tags can be translated into OpenDocument stuff). The most recent release of jsWorks:
https://github.com/jsuzineau/pascal_o_r_mapping/releases/tag/2019_04_24_jsWorks

Reply by email