#1 2015-12-15 12:34:00

AOG
Member
Registered: 2014-02-24
Posts: 490

Smart Mobile Studio

@ab

Your framework allows for very (very) easy and elegant persistence. Thanks for that.

However, the users demand mobile access.
For Android: do-able with Delphi and/or FPC.
For Apple not that easy.

But the web is there. And Smart Mobile Studio (SMS) offers Pascal for the Web.
SMS looks very promissing. But its closed source.
Its development stalls, due to lack of time/money/drive ?!
The forum is quite.

I would like to hear your opinion about web-access of your REST servers.
What would be the best way to go.
And with best I mean a direction that will be ok for the next couple of years (3-5).

I tried the SLIM framework. Tried SMS. Tried some of the Samples you provide.

Thanks !

ps:
your SMS samples do not compile anymore with the latest SMS on my systems ... can you reproduce ?

Offline

#2 2015-12-15 13:19:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Smart Mobile Studio

I still use SMS for my own projects, since
- I have some code which compiles and run with Delphi, FPC and SMS: I can debug the logic on Windows, then it works on SMS almost everytime;
- I'm able to deploy applications on Android and iPhone (and any other system) as HTML5 app, by-passing the iTunes/GooglePlay stores.
- And they still run offline.
IMHO those are a huge benefit.

I would never use a PHP framework.

But SMS is not actively developed...
What I mostly use is their compiler, and Chrome debugger.
So it does not matter much to me.
For the UI, the Smart components are too few... I am currently using the CSS part of Ionic, which renders very well. See http://ionicframework.com/docs/components

Offline

#3 2015-12-16 06:40:42

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: Smart Mobile Studio

Does anybody try to use Elevate Web Builder?

Offline

#4 2015-12-16 08:02:34

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Smart Mobile Studio

I tried, but the language was not at the same level, it was focusing on DB/RAD apps, and the UI was - at least at this time - targeting desktop applications, not mobile applications.
Now there are some responsive design abilities...
And EWB seems more supported than SMS, and did change a lot from the begining. The 2nd has indeed a disappointing very slow change rate.

I may try EWB once more.

Offline

#5 2015-12-16 10:44:09

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Re: Smart Mobile Studio

And OpenUI5 ? the enterarse Daesh opten Sucre Project firm SAP http://openui5.org


Esteban

Offline

#6 2015-12-16 13:41:46

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

@EMartin

OpenUI5 ... never heard of ... just tried it with Sample 4 ... tooks some minutes, but not many ... works ... and looks great !!

Do you have more experience with it ?

Offline

#7 2015-12-16 15:22:44

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Re: Smart Mobile Studio

Not yet, but will use it.


Esteban

Offline

#8 2015-12-16 17:48:42

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Smart Mobile Studio

You can use Smart Mobile Studio basic version and connect to the mORMot server, which generates wrapper class ready to be used.
· Handle authentication/security and
· Perform all the CRUD operations (delete, update, add and get) with ORM records.

With SMS Basic version, you can not use the visual components library, layouts, but you can build HTML5/CSS3 views manually - you can use mORMot wrapper generated classes! For instance, you can use CSS parts of ionics to create responsive views.

You can use the smart mobile studio command-line compiler (SMSC.EXE), to compile smart pascal to javascript. However, since this tool is available for free it is not allowed to redistribute for money, you can not sell a product that contains the command line compiler.

Offline

#9 2015-12-16 18:08:42

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Re: Smart Mobile Studio

The enterprise ready feature of OpenUI5 that include datagrid (not all web frameworks has it) is superior, for me, to others frameworks.


Esteban

Offline

#10 2015-12-16 18:12:11

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Smart Mobile Studio

your SMS samples do not compile anymore with the latest SMS on my systems ... can you reproduce ?

I suppose you are talking about webform project. Indeed, SMS 2.2.0.4165 have some issues related to exported forms.

Please open WebForm.sproj with an external text editor and copy-paste this.
Now you can compile this project on both 2.1.2.3592 and 2.2.0.4165 versions.

<SMART>
  <Project version="2" subversion="1">
    <Name>WebForm</Name>
    <Created>T00:00:00.000</Created>
    <Modified>2015-10-16T19:03:27.953</Modified>
    <Author>A. Bouchez</Author>
    <Company>Synopse</Company>
    <Version>
      <Major>1</Major>
      <Minor>18</Minor>
      <Revision>0</Revision>
    </Version>
    <Apple>
      <FormatDetection>1</FormatDetection>
      <StatusBarStyle>default</StatusBarStyle>
      <WebAppCapable>1</WebAppCapable>
    </Apple>
    <Options>
      <PostBuild>
        <Enabled>0</Enabled>
        <Script>//CopyFile(&apos;.\www\index.html&apos;,&apos;.\www\debug\index.html&apos;,true);</Script>
      </PostBuild>
      <Compiler>
        <Assertions>1</Assertions>
        <Optimize>1</Optimize>
        <HintsLevel>1</HintsLevel>
      </Compiler>
      <Codegen>
        <Obfuscation>0</Obfuscation>
        <RangeChecking>0</RangeChecking>
        <InstanceChecking>0</InstanceChecking>
        <ConditionChecking>1</ConditionChecking>
        <LoopChecking>1</LoopChecking>
        <InlineMagics>1</InlineMagics>
        <EmitSourceLocation>1</EmitSourceLocation>
        <EmitRTTI>0</EmitRTTI>
        <Devirtualize>1</Devirtualize>
        <MainBody>1</MainBody>
        <CodePacking>0</CodePacking>
        <SmartLinking>1</SmartLinking>
        <Verbosity>1</Verbosity>
      </Codegen>
      <ConditionalDefines>
        <HandleExceptions>1</HandleExceptions>
        <AutoRefresh>0</AutoRefresh>
      </ConditionalDefines>
      <Linker>
        <SourceMap>0</SourceMap>
        <CompressCSS>1</CompressCSS>
        <GenerateMobileManifest>1</GenerateMobileManifest>
        <GenerateChromeManifest>0</GenerateChromeManifest>
        <GenerateFireFoxManifest>0</GenerateFireFoxManifest>
        <GenerateWidgetPackageConfigXML>0</GenerateWidgetPackageConfigXML>
        <ExternalCSS>0</ExternalCSS>
        <Theme>default.css</Theme>
        <CustomTheme>0</CustomTheme>
        <EmbedJavaScript>1</EmbedJavaScript>
      </Linker>
      <Output>
        <HtmlFileName>index.html</HtmlFileName>
        <OutputFilePath>www\</OutputFilePath>
      </Output>
      <Import />
      <Execute>
        <ServeManifest>0</ServeManifest>
        <Server>0</Server>
        <PauseAfterExecution>0</PauseAfterExecution>
        <ExecuteType>2</ExecuteType>
        <ExecuteableName>chrome.exe</ExecuteableName>
        <ExecuteableParams>%output%</ExecuteableParams>
      </Execute>
    </Options>
    <Files>
      <File type="main">
        <Name>WebForm</Name>
        <Created>2015-05-22T16:09:59.328Z</Created>
        <Modified>2015-05-24T21:54:48.785</Modified>
        <Source>
          <![CDATA[uses MainUnit, LoginForm, SynDate;

{$IFDEF SMART_INTERNAL_HANDLE_EXCEPTIONS}
uses SmartCL.System;
{$ENDIF}

{$IFDEF SMART_INTERNAL_AUTO_REFRESH}
uses SmartCL.AutoRefresh;
TW3AutoRefresh.Create.Start;
{$ENDIF}

var Application: TApplication;

{$IFDEF SMART_INTERNAL_HANDLE_EXCEPTIONS}
try
{$ENDIF}

  Application := TApplication.Create;
  Application.RunApp;

{$IFDEF SMART_INTERNAL_HANDLE_EXCEPTIONS}
except
  on e: Exception do
    ShowMessage(e.Message);
end;
{$ENDIF}
]]>
        </Source>
      </File>
      <File type="unit">
        <Name>MainUnit</Name>
        <Created>2014-06-17T10:47:09.813Z</Created>
        <Modified>2015-05-25T20:40:46.500</Modified>
        <Source>
          <![CDATA[unit MainUnit;

interface

uses 
  SmartCL.System, SmartCL.Components, SmartCL.Forms, SmartCL.Application,
  SynCrossPlatformCrypto, SynCrossPlatformSpecific, SynCrossPlatformREST,
  SmartTests,
  LoginForm;

type
  TApplication = class(TW3CustomApplication)
  private
    FForm1: TLoginForm;
  protected
    procedure ApplicationStarting; override;
  public

  end;

implementation

{ TApplication}

procedure TApplication.ApplicationStarting;
begin
  FForm1 := TLoginForm.Create(Display.View);
  FForm1.Name := 'Form1';
  RegisterFormInstance(FForm1, True);
  // register other forms here

  inherited;
end;


end.
]]>
        </Source>
      </File>
      <File type="form">
        <Name>LoginForm</Name>
        <Created>2014-06-17T10:47:09.813Z</Created>
        <Modified>2015-05-22T16:10:08.171</Modified>
        <Source>
          <![CDATA[unit LoginForm;

interface

uses 
  SmartCL.System, SmartCL.Graphics, SmartCL.Components, SmartCL.Forms,
  SmartCL.Fonts, SmartCL.Borders, SmartCL.Application,
  SynCrossPlatformREST, SmartTests,
  SmartCL.Controls.Label, SmartCL.Controls.Editbox, SmartCL.Controls.Panel,
  SmartCL.Controls.Button, w3c.date;

type
  TLoginForm=class(TW3form)
    procedure W3Button1Click(Sender: TObject);
    procedure ConnectClick(Sender: TObject);
  private
    {$I 'LoginForm:intf'}
  protected
    procedure InitializeForm; override;
    procedure InitializeObject; override;
    procedure Resize; override;
  end;

implementation

uses
  mORMotClient; // unit generated by the server!

{ TLoginForm }

procedure TLoginForm.InitializeForm;
begin
  inherited;
  // this is a good place to initialize components
end;

procedure TLoginForm.InitializeObject;
begin
  inherited;
  {$I 'LoginForm:impl'}
  LogonPassword.InputType := itPassword;
end;

procedure TLoginForm.ConnectClick(Sender: TObject);
var model: TSQLModel;
begin
  BrowserAPI.console.time('ORM');
  writeln('Creating Data Model');
  model := GetModel;
  model.GetTableIndexExisting(TSQLRecordPeople);
  var people := new TSQLRecordPeople;
  var s := model.InfoExisting(people.RecordClass).ToJSONAdd(nil,people,true,'');
  assert(s='{"RowID":0,"FirstName":"","LastName":"","YearOfBirth":0,"YearOfDeath":0,'+
    '"Sexe":0,"Simple":{"F":"","G":[],"H":{"H1":0,"H2":"","H3":{"H3a":false,"H3b":null}},"I":"","J":[]}}');
  s := '{"RowID":10,"FirstName":"ab\"c","LastName":"def","YearOfBirth":20,"YearOfDeath":30,'+
    '"Sexe":1,"Simple":{"F":"","G":[],"H":{"H1":0,"H2":"","H3":{"H3a":false,"H3b":null}},"I":"","J":['+
      '{"J1":1,"J2":"","J3":"reLast"}]}}';
  assert(people.FromJSON(s));
  assert(people.ID=10);
  assert(people.FirstName='ab"c');
  assert(people.LastName='def');
  assert(people.YearOfBirth=20);
  assert(people.YearOfDeath=30);
  assert(people.Sexe=sMale);
  assert(people.Simple.J.Count=1);
  assert(people.Simple.J[0].J1=1);
  assert(people.Simple.J[0].J3=reLast);
  writeln('Connecting to the server at '+ServerAddress.Text+':888');
  GetClient(ServerAddress.Text,LogonName.Text,LogonPassword.Text,
  lambda(client)
    client.LogToRemoteServer(LOG_VERBOSE,'localhost');
    writeln('Safely connected with SessionID='+IntToStr(client.Authentication.SessionID));
    people := TSQLRecordPeople.Create(client,1);
    assert(people.ID=1);
    writeln(people.ToJSON(client.Model,'*'));
    writeln('Testing remote CRUD methods');
    ORMTest(client);
    BrowserAPI.console.timeEnd('ORM');
    BrowserAPI.console.time('SOA');
    writeln('Testing SOA remote access');
    SOATest(client,
    lambda
      writeln('Disconnect from server');
      client.Free;
      BrowserAPI.console.timeEnd('SOA');
    end,
    lambda
      writeln('ERROR!');
      writeln('Disconnect from server');
      client.Free;
      BrowserAPI.console.timeEnd('SOA');
    end);
  end,
  lambda
    ShowMessage('Impossible to connect to the server');
    writeln('ERROR at GetClient');
    BrowserAPI.console.timeEnd('ORM');
  end);
end;

procedure TLoginForm.W3Button1Click(Sender: TObject);
begin
  BrowserAPI.console.time('LowLevel');
  TestSMS;
  BrowserAPI.console.timeEnd('LowLevel');
end;

procedure TLoginForm.Resize;
begin
  inherited;
end;
 
end.
]]>
        </Source>
        <Design>
          <![CDATA[<?xml version="1.0" encoding="utf-16"?>
<Form version="2" subversion="1">
  <Created>2014-06-17T10:47:09.864</Created>
  <Modified>2014-07-18T15:32:06.707</Modified>
  <object type="TW3Form">
    <Caption>mORMot Web Test</Caption>
    <Name>LoginForm</Name>
    <object type="TW3Label">
      <Caption>&lt;b&gt;&lt;i&gt;mORMot&lt;/i&gt; Web Test&lt;/b&gt;</Caption>
      <Width>184</Width>
      <Top>8</Top>
      <StyleClass>h1</StyleClass>
      <Left>32</Left>
      <Height>32</Height>
      <Transparent>True</Transparent>
      <Name>W3Label1</Name>
    </object>
    <object type="TW3Panel">
      <Width>192</Width>
      <Top>40</Top>
      <Left>24</Left>
      <Height>264</Height>
      <Name>W3Panel1</Name>
      <object type="TW3EditBox">
        <Value></Value>
        <Text>User</Text>
        <Range></Range>
        <Width>128</Width>
        <Top>104</Top>
        <Left>16</Left>
        <Height>32</Height>
        <Name>LogonName</Name>
      </object>
      <object type="TW3Label">
        <Caption>Name</Caption>
        <Width>56</Width>
        <Top>80</Top>
        <Left>16</Left>
        <Height>24</Height>
        <Name>W3Label3</Name>
      </object>
      <object type="TW3Label">
        <Caption>Password</Caption>
        <Width>128</Width>
        <Top>136</Top>
        <Left>16</Left>
        <Height>32</Height>
        <Name>W3Label4</Name>
      </object>
      <object type="TW3EditBox">
        <Value></Value>
        <Text>synopse</Text>
        <Range></Range>
        <Width>128</Width>
        <Top>168</Top>
        <Left>16</Left>
        <Height>32</Height>
        <Name>LogonPassword</Name>
      </object>
      <object type="TW3Button">
        <Caption>Remote Tests</Caption>
        <Width>160</Width>
        <Top>208</Top>
        <Left>16</Left>
        <Height>40</Height>
        <Name>Connect</Name>
        <OnClick>ConnectClick</OnClick>
      </object>
      <object type="TW3EditBox">
        <Value></Value>
        <Text>127.0.0.1</Text>
        <Range></Range>
        <Width>128</Width>
        <Top>160</Top>
        <Left>240</Left>
        <Height>32</Height>
        <Name>W3EditBox1</Name>
      </object>
      <object type="TW3Label">
        <Caption>Server</Caption>
        <Width>128</Width>
        <Top>8</Top>
        <Left>16</Left>
        <Height>32</Height>
        <Name>W3Label2</Name>
      </object>
      <object type="TW3EditBox">
        <Value></Value>
        <Text>127.0.0.1</Text>
        <Range></Range>
        <Width>128</Width>
        <Top>40</Top>
        <Left>16</Left>
        <Height>32</Height>
        <Name>ServerAddress</Name>
      </object>
    </object>
    <object type="TW3Button">
      <Caption>Offline Tests</Caption>
      <Width>160</Width>
      <Top>312</Top>
      <Left>40</Left>
      <Height>40</Height>
      <Name>W3Button1</Name>
      <OnClick>W3Button1Click</OnClick>
    </object>
  </object>
</Form>]]>
        </Design>
        <AutoCreate>
          <IsAutoCreate>1</IsAutoCreate>
          <IsMainForm>1</IsMainForm>
          <Order>1</Order>
        </AutoCreate>
      </File>
      <File type="unit">
        <Name>SynDate</Name>
        <Created>2015-05-24T21:54:27.308Z</Created>
        <Modified>2015-05-24T21:55:23.323</Modified>
        <Source>
          <![CDATA[unit SynDate;

interface

uses 
  System.Types,
  SmartCL.System,
  w3c.Date;

type
  JDateHelper = helper for JDate
    private
      function GetAsDateTime : TDateTime;
      function GetAsLocalDateTime : TDateTime;
      procedure SetAsDateTime(dt : TDateTime);
      procedure SetAsLocalDateTime(dt : TDateTime);

    public
      property AsDateTime : TDateTime read GetAsDateTime write SetAsDateTime;
      property AsLocalDateTime : TDateTime read GetAsLocalDateTime write SetAsLocalDateTime;
  end;

implementation

function JDateHelper.GetAsDateTime : TDateTime;
begin
  Result := Self.getTime / 864e5 + 25569;
end;

procedure JDateHelper.SetAsDateTime(dt : TDateTime);
begin
  Self.setTime((dt - 25569) * 864e5);
end;

function JDateHelper.GetAsLocalDateTime: TDateTime;
begin
  Result := (Self.getTime - 60000 * Self.getTimezoneOffset) / 864e5 + 25569;
end;

procedure JDateHelper.SetAsLocalDateTime(dt: TDateTime);
begin
  Self.setTime((dt - 25569) * 864e5 + 60000 * Self.getTimezoneOffset);
end;

end.
]]>
        </Source>
      </File>
    </Files>
    <Target>Browser</Target>
    <Generator>Visual Component Project</Generator>
  </Project>
</SMART>

Offline

#11 2015-12-17 03:24:26

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Smart Mobile Studio

The best html5 based mobile web UI framework I found so far: http://www.idangero.us/framework7/

Smart Mobile Studio is cool and I love the Object Pascal language, but I wouldn't use SMS because it's not well-documented the last time I checked. On the hand, if you use JavaScript you'll find that you can find ready-to-use solutions and documents for every single problem you might encounter.

Last edited by edwinsn (2015-12-17 09:10:36)


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#12 2015-12-17 08:17:07

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Smart Mobile Studio

Framework7 sounds great!

Offline

#13 2015-12-17 11:30:55

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Smart Mobile Studio

I just created a wrapper around Framework7 to be used with Smart Mobile Studio. it's not finished yet. You can use SMS basic version and consume mORMot services.

Live preview:
https://rawgit.com/smartpascal/smartms/ … eview.html

Offline

#14 2015-12-17 12:10:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Smart Mobile Studio

@warleyalex
This sample is just great!

Could you please publish the source code, once stabilized, so that we may be able to publish it as third-party sample?
It may be a very good starting point for other users...

Framework7 rendering sounds fine and responsive, even on a mobile.

Direct URI for a mobile app may be https://rawgit.com/smartpascal/smartms/ … index.html

Offline

#15 2015-12-18 08:57:34

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Smart Mobile Studio

@warleyalex, you are fast! And it also proves that Framework7 is easy to use while powerful smile


@ab, I inferred the github repository of warleyalex's example: https://github.com/smartpascal/smartms


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#16 2015-12-18 16:44:57

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Smart Mobile Studio

@edwin
AFAIK there is no source in this github repository, only the html/js resulting from compilation with SMS.

Offline

#17 2015-12-18 22:10:12

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Smart Mobile Studio

This is a very experimental SMS + F7 + mORMot
Compiled with SMS Basic Version (v2.1.0.3592)

https://www.dropbox.com/s/zwpwqa2fh1k1u … 7.rar?dl=0

I have included some mORMot SmartPascal tests, unfortunately, we have some issues in SMS ver 2.2.0.4165 (Offline Tests); for instance (at SmartTests.pas), we get different results:
  s := '2014-06-28T11:50:22';
  D := Iso8601ToDateTime(s);
// ver2.1.2.3592 D= 41818.493310185186 --> 6/28/14 11:50:22
// ver2.2.0.4093 D= 41818.305810185186 --> 6/28/14 7:20:22

I have replaced SmartCL.System and System.Types  to SmartCL.System.Lite to compiler generate small JS code. A webserver to run the project is required.

---------
I've discovered today, SmartTests.pas will work as expected with the latest SMS  2.2.0.4165 beta4 if you edit SynCrossPlatformSpecific unit and include "System.DateUtils" unit.

  SmartCL.System.Lite,
  System.Date,
  System.DateUtils,
  w3c.date;

I also have to edit DateTimeToIso8601 function which uses the function FormatDateTime, this function expects an extra param.

function DateTimeToIso8601(Value: TDateTime): string;
begin // e.g. YYYY-MM-DD Thh:mm:ss or YYYY-MM-DDThh:mm:ss
  if Value<=0 then
    result := '' else
  if frac(Value)=0 then
    result := FormatDateTime('yyyy-mm-dd',Value,DateTimeZone.UTC) else
  if trunc(Value)=0 then
    result := FormatDateTime('Thh:nn:ss',Value,DateTimeZone.UTC) else
    result := FormatDateTime('yyyy-mm-ddThh:nn:ss',Value,DateTimeZone.UTC);
end;

Last edited by warleyalex (2015-12-20 22:09:47)

Offline

#18 2015-12-23 16:53:12

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

Re: Smart Mobile Studio

Seems like there is a better future for SMS, time will tell:

https://jonlennartaasenden.wordpress.co … le-studio/

Merry christmas to you all !

Offline

#19 2015-12-23 18:06:05

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Smart Mobile Studio

@moctes
Nice blog article, but we do not need stories about SMS potential and implementation wishes, but real working features.

Some ideas sounds like FUD to me, from the technical point of view.
Running too many races at once for a small company is never a good idea.
We do not need to know what SMS "can do", but what SMS "does". Focusing on a single target, e.g. mobile apps with a decent UI (not the current RAD approach, which is difficult to work with on real projects with a lot of screens) would be a good start.

For instance, JavaScript for IoT is a joke.
A Raspberry PI is not a IoT target, it is a whole computer.
A true IoT device is e.g. https://en.wikipedia.org/wiki/ESP8266 - and you won't run JavaScript on it! but FPC maybe.

So come on, Smart Company!
Pick up a clear goal, and focus on it!
smile

Offline

#20 2016-01-05 06:43:55

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Smart Mobile Studio

Another web frontend framework that might be of interesting is VCL.JS - it's based on TypeScript (a language which is very similar to Delphi created by the same creator of Delphi), and it mimics the VCL's conception for component encapsulation based for the most popular html framework Twitter BootStrap.

http://www.vcljs.com/Demo/#show/PageHome/7b7d


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#21 2016-01-05 19:59:26

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

@All, @EMartin

I have written a model for OpenUI5, that can communicate directly with a mORMot REST server.
It uses some of the odata features, but mostly client side features and on-demand data-loading.

I am performing the last tests and will send an example to Ab soon. To get final advice.
I, for myself, am very happy and impressed by OpenUI5.

Once the model is there, all other things are very easy by OpenUI5 magic !!

Offline

#22 2016-01-06 08:14:45

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Smart Mobile Studio

@AOG, that must be very helpful for people who want to consume a  mORMot-powered REST server from inside the browser using JS!

BTW, you must have chosen OpenUI5 for good reasons, care to tell us briefly about why you have chosen it over other html frontend frameworks? Thanks in advance.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#23 2016-01-06 09:10:12

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

@edwinsn

To be honest, I just heard of OpenIU5 from a previous message in this message thread (by EMartin).

In the (very recent) past, I had a lot of work implementing business logic for mORMot webaccess.
OpenUI5 seemed a perfect fit !
OpenUI5 has all that you need, regarding business-logic.
And much much more for making a nice UI.

The demo I am preparing will show you the ease of use.
It is still limited to read-only, but I am already working on that !

Offline

#24 2016-01-06 09:43:44

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

First commit here: https://github.com/LongDirtyAnimAlf/OpenUI5_mORMot/
Please be kind ... ;-)

Offline

#25 2016-01-18 13:53:57

Leslie7
Member
Registered: 2015-06-25
Posts: 248

Re: Smart Mobile Studio

AB,

Do you consider SMS to be stable enough to be used with mormot? (The none UI part)

Last edited by Leslie7 (2016-01-18 13:59:34)

Offline

#26 2016-01-18 13:59:08

Leslie7
Member
Registered: 2015-06-25
Posts: 248

Re: Smart Mobile Studio

Any news on the UI front? OpenIU5 , Framework7 ...? I am looking  for a production ready UI solution to be used with mORMot.

Offline

#27 2016-01-18 14:13:27

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

Well ... I am working very hard at the moment to get the combi mORMot / OpenUI5 running.

You can try :

https://github.com/LongDirtyAnimAlf/OpenUI5_mORMot

Basic CRUD is ok.
Now I am working on the pending changes feature !

Offline

#28 2016-01-18 15:24:57

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Re: Smart Mobile Studio

Great work AOG !!!

Do you converting from/to OData protocol to REST ? If so do you read this posts ?

http://scn.sap.com/community/developer- … json-model

and

http://scn.sap.com/community/developer- … ce--part-3

Your demo use Lazarus, can you make the demo Delphi compatible ? I use Delphi 7 only.

Thanks.

Esteban


Esteban

Offline

#29 2016-01-18 15:39:52

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

Yes, I looked at these posts.
But they all extend the very simple client side standard JSON model.

The OData model has much more features.
And will receive much more attention and updates in the future.

Thats why I decided to hack the OData model.
Until now, with great success.
Nearly all OData features are working.

I will add a Delphi server in short notice !!

Offline

#30 2016-01-18 16:07:59

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Re: Smart Mobile Studio

Thanks AOG, I'll wait your Delphi version of your demo !!!


Esteban

Offline

#31 2016-01-18 17:17:30

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Smart Mobile Studio

I also don't have Lazarus, server for D7 would be nice. Anyway I have been able to successfully test the demo and worked fine.

You have a ListView for calling remote mORMot JSON data, in your example, you're populating the ListView with remote JSON using the ORM select=* (it displays all records/items at once).

Would be nice to implement a ListView (lazy loading / infinite scrolling feature) for fetching remote JSON data. For instance, initially displays 10 data at one time and as the user scrolls down, more data is loaded.

Offline

#32 2016-01-18 23:20:13

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

Delphi project (dpr) added !

Some form of lazy loading is enabled by just loading the necessary data when needed.
But couting would be better.

Needs a few changes for the mORMot however:
mORMot can report back a total remaining (count) records.
OpenUI5 needs next available records.

I have enabled two-way-binding !
Give it a try. Not perfect, but a very nice feature of OpenUI5 !!

Offline

#33 2016-01-18 23:52:16

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: Smart Mobile Studio

It works, but dpr in Delphi should look like this:

program SAPUI5Server;

uses
  Forms,
  Main in 'Main.pas' {Form1},
  SampleData in 'SampleData.pas';

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

Michal

Offline

#34 2016-01-19 07:01:39

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

Done. Thanks.

ps:
Delphi(7) users should give FPC\Lazarus a try !
Among many other things, it will give you multi-platform !!

Offline

#35 2016-01-19 08:20:17

miab3
Member
From: Poland
Registered: 2014-10-01
Posts: 188

Re: Smart Mobile Studio

I use Delphi 10 Seattle but I do not avoid from Lazarus and especially CodeTyphon which is heavily multi-platform.

Offline

#36 2016-01-19 17:25:47

Leslie7
Member
Registered: 2015-06-25
Posts: 248

Re: Smart Mobile Studio

AOG,

You seem to write a lot of JS code. Would it not be better to use SMS? It would allow Delphi/Lazarus programmers to join.

Anyway, Great work!

Leslie

Offline

#37 2016-01-19 17:27:28

Leslie7
Member
Registered: 2015-06-25
Posts: 248

Re: Smart Mobile Studio

It seems the SMS team is getting more envolved : http://smartmobilestudio.com/news/

Offline

#38 2016-01-19 22:02:20

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

@Leslie7
I tried SMS ... and did not succeed (yet) ... but if they get things going, I will give it a very serious go !!

But, since my discovery of OpenUI5, and looking into great detail into their methods, I am very impressed !
Just try the two way binding ... its very nice.
And the canceling of pending changes !!

@All.
TSQLRawBlobs are now supported.
They can also be changed by uploading new data !

Offline

#39 2016-01-20 09:47:39

Leslie7
Member
Registered: 2015-06-25
Posts: 248

Re: Smart Mobile Studio

AOG,

Maybe there is a slight misunderstanding here. What I  meant was creating the  code to interface OpenUI5 with mORMot in pascal using SMS. It could be a better fit for Delphi/FPC programmers who are recluctant to get into the depths of JS. It could make locating problems easier or adding their own work.

Offline

#40 2016-01-21 07:16:35

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

Nice idea !
But to implement this, I would have to use SMS to generate OData metadata on-the-fly.
Which would be a very complex task (for me).

However, I am still thinking of asking Ab to add some extra info into the REST server that mimics part of the OData metadata.
A list of tables with their fields and datatypes (at ...:8080/root/$metadata) could to wonders ... ;-) .... !!!

But for now, I am sticking to the standard features of mORMot and try to get as far as possible.
Goal is to get the REST model to do full CRUD with mORMot.

Offline

#41 2016-01-21 18:06:36

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

Added mORMot authentication into OpenUI5 REST model !!

See : https://github.com/LongDirtyAnimAlf/OpenUI5_mORMot/

Thanks @esmondb for the auth-code.

Offline

#42 2016-01-22 07:09:45

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Smart Mobile Studio

Well done AOG, although I wish you have used AngularJS or other popular js frameworks those are more obvious to customize the UI at the html/css level instead smile


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#43 2016-01-22 08:41:07

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

Thanks.

You are right regarding the UI customizing ... OpenUI5 looks not that exiting ... and these looks are not easily modified.
But I was seduced by the business-logic already available in the framework.
Its made for databases, and mORMot is a database.

So, the only thing needed to get OpenUI5 things running was a mod of the OData model.
And, as from now, OpenUI5 can be used with mORMot.

My personal needs were also important:
mORMot backend on a 64 bit Arch Linux T2 tier in the AWS (Amazon) cloud.
Win/Mac/Linux GUI's.
Mobile client for quick and dirty updates of the database.

I have made (native) mobile clients with Delphi and FPC (android).
Decided that a web-interface is better in the long run : no install and suitable for all systems.
And also important: youngsters do not know a desktop anymore ... ;-)

Offline

#44 2016-01-22 10:24:18

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Re: Smart Mobile Studio

I'm not completely sold on twitter's bootstrap. OpenUI5 and vcljs look really interesting. I tried bootstrap version 2, but needed to make quite a few tweaks for my use case. Then version 3 broke my tweaks and changed default css box-sizing causing more problems. Version 4 seems delayed.

Offline

#45 2016-01-22 12:38:16

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Smart Mobile Studio

For a web client, also consider a "classical" dynamic web site.
The MVC feature of mORMot, using Mustache templates, is very powerful.
See http://synopse.info/files/html/Synopse% … l#TITL_108

Those HTML5 frameworks are great for mobile apps, but a dynamic web site could be much easier to implement and maintain.
Much less javascript to write and debug!

Offline

#46 2016-01-23 07:35:46

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

@ab
100% agreed ... but mobile is a must for my current app ...

Offline

#47 2016-01-23 18:41:03

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: Smart Mobile Studio

Huge refactoring of mORMot REST model for OpenUI5.

Metadata generated by mORMot server ... somewhat similar to OData metadata.
Lazyloading fully enabled.
Server side sorting and filtering enabled.

Still not 100%, but worth a try .... ;-)

Offline

#48 2016-01-23 20:14:44

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Smart Mobile Studio

I'll take a look at OData features.
Even if I was never convinced by the OData protocol - see http://www.odata.org - about e.g. URI encodings, which are IMHO not truly RESTful, but over engineered, like most OASIS standards, or MS-defined tricks. Big companies do gender non-sense monstruous ideas...

For instance, the following, to retrieve a resource, is a real PITA:

GET http://services.odata.org/v4/TripPinServiceRW/People('russellwhyte') HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0

What is this People('keyname') syntax about?
Where does it come from? Not from REST definition, for sure!
See https://www.ics.uci.edu/~fielding/pubs/ … _style.htm and http://synopse.info/files/html/Synopse% … tml#TITL_9

And the more you are going into the standard, the worse...

Offline

#49 2016-01-23 22:41:37

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: Smart Mobile Studio

Getting off the subject. Mr. Christian-W. Budde has released a ts2pas a tool to convert TypeScript definition files (.d.ts) to DWScript based Object Pascal headers (.pas)

Offline

#50 2016-01-25 09:36:10

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Smart Mobile Studio

@AOG
I've taken a look at your nice OData implementation.
There is an issue with Int64 values...
All integer values are defined as "Edm.Int32", whereas we may return much more information, e.g. up to 38 bits for a TTimeLog and up to 64 bits for a TID (in practice, up to 63 bits for TSynUniqueIdentifier).
AFAIK, due to restriction of JavaScript numbers of 53-bit resolution for integers, we should transmit TID as strings... sad
In fact, this is what OData expect for "Edm.Int64" fields: they should be transmitted as strings!
This resolution issue may affect any kind of AJAX clients... sad

Offline

Board footer

Powered by FluxBB