#2 mORMot 1 » How do I save the session? » 2017-09-06 08:40:19

wac1104
Replies: 1

How do I save the session using TSQLRestServerFullMemory

procedure TRestServer.UserLogin(CTXt:TSQLRestServerURIContext);
var
  User:TUserInfo;
  P:PUTF8Char;
  js:string;
  SessionID:integer;
begin
  User :=TUserInfo.Create;
  try
  if UrlDecodeNeedParameters(Ctxt.Parameters,'USERINFO') then
  begin
    UrlDecodeObject(CTXt.Parameters,'USERINFO=',User);
  end;
  finally
    FreeAndNil(User);
  end;


end;

#3 mORMot 1 » Does mormot support raspberry Raspberry Pi 3? » 2017-09-05 08:46:27

wac1104
Replies: 2

Does mormot support raspberry Raspberry Pi 3?
arm linux

#4 mORMot 1 » urldecodeobect function CSVNAMES Param must be uppercase ? » 2017-09-05 08:38:36

wac1104
Replies: 2

Parameter must be uppercase?
     UrlDecodeObject (CTXt.Parameters, 'USERINFO =', User);

#5 Re: mORMot 1 » Mormot doesn't seem to be a lightweight architecture » 2017-09-05 07:17:14

I mean that I only use the restuful part also need to build such an object TSQLMODEL? This coupling is too tight

#6 Re: mORMot 1 » What is the use of TSQLmodel? » 2017-09-05 06:35:19

My ClientCode

procedure TestRestfullHttpClient.SetUp;
begin
  inherited;
  FModel :=TSQLModel.Create([TUserInfo],'service');
  FClient :=TSQLRestClientURINamedPipe.Create(FModel,'RestService');
end;

procedure TestRestfullHttpClient.TearDown;
begin
  FreeAndNil(FClient);
  inherited;

end;

procedure TestRestfullHttpClient.TestRestuFullClientAccess;
var
  UserInfo :TUserInfo;
begin
  UserInfo :=TUserInfo.Create;
  try
    UserInfo.UserName :='EricWang';
    UserInfo.Password :='123456';
    UserInfo.SessionKey :='sldkjfa;lkdjf';
    UserInfo.Version :='1.125';
    UserInfo.ProductID :=3;
    Fclient.CallBackGetResult('UserLogin',[UserInfo]);

  finally
    FreeAndNil(UserInfo);
  end;

#7 Re: mORMot 1 » What is the use of TSQLmodel? » 2017-09-05 06:33:47

My ServerCode

unit frm_Server;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs,SynCommons,mORMot,mORMotHttpServer,data_record,
  Vcl.StdCtrls;

type
  THttpServer=class(TSQLRestServerFullMemory)
  published
    procedure UserLogin(CTXt:TSQLRestServerURIContext);
  end;
  TForm1 = class(TForm)
    Button1: TButton;
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    FModel: TSQLModel;
    { Private declarations }
    FServer:THttpServer;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormDestroy(Sender: TObject);
begin
  if Assigned(FServer) then FreeAndNil(FServer);
  if Assigned(FModel) then FreeAndNil(FModel);

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  button1.Enabled :=false;
  if Assigned(FServer) then FreeAndNil(FServer);

  if Assigned(FModel) then FreeAndNil(FModel);

  FModel  :=TSQLModel.Create([TUserInfo],'service');
  FServer :=THttpServer.Create(FModel);
  FServer.ExportServerNamedPipe('RestService');
  Button1.Enabled :=true;

end;

procedure TForm1.FormCreate(Sender: TObject);
begin

end;

{ THttpServer }

procedure THttpServer.UserLogin(CTXt:TSQLRestServerURIContext);
var
  User:TUserInfo;
  P:PUTF8Char;
begin
//
  //
  P :=CTXt.Parameters;

end;

end.

#8 Re: mORMot 1 » What is the use of TSQLmodel? » 2017-09-05 06:30:11

I tried this  code Fclient.CallBackGetResult ('UserLogin', [UserInfo]);
but  httpserver  recive   nil ctxt.parmaters
procedure THttpServer.UserLogin (CTXt: TSQLRestServerURIContext);
var
   User: TUserInfo;
   P: PUTF8Char;
begin
//
   //
   P: = CTXt.Parameters;
end

#9 Re: mORMot 1 » What is the use of TSQLmodel? » 2017-09-05 06:26:26

I would like to send the  TSQLrecord object  to restful server how do i do?

#10 mORMot 1 » What is the use of TSQLmodel? » 2017-09-05 06:20:01

wac1104
Replies: 5

I found that I used sample06   client to build a tsqlmodel
What is the use of TSQLmodel?

#11 mORMot 1 » Mormot doesn't seem to be a lightweight architecture » 2017-09-05 05:04:30

wac1104
Replies: 3

Mormot doesn't seem to be a lightweight architecture; I want to use only restful parts of the database, use unidac or something else, but it seems that only the mort architecture can be used to access the database

#12 mORMot 1 » About Big Data Support » 2017-08-30 08:43:12

wac1104
Replies: 7

Hi Ab

Is mormot able to build a framework for supporting large data? 
example :Hadoop (hdfs+mapreduce, hbase )

#13 Re: mORMot 1 » I have an expression parser unit that wants to join mormot » 2017-08-30 01:58:25

usually i can use this  unit   process data filter    operatoion 
this unit support    >  <  >=  <=  AND  OR NOT   Equal    operotor.   you can  easily  extend support   XML   Json    Csv  and other data file  search  filter.

#14 Re: mORMot 1 » I have an expression parser unit that wants to join mormot » 2017-08-30 01:50:33

This is My Project address
https://github.com/Ericwang1104/PasExpressParser

This is a simple version, you can easily extend support for csv json xml and other data formats

#15 mORMot 1 » I have an expression parser unit that wants to join mormot » 2017-08-29 09:05:54

wac1104
Replies: 3

hi ab:
    I have an expression parser unit that wants to join mormot ,
Do you need it?

#16 Free Pascal Compiler » install fpcupdeluxe cross -compiler found error » 2017-08-28 06:42:52

wac1104
Replies: 1

errorinfo:
:\fpcupdeluxe\fpcbootstrap\make.exe: *** [build-stamp.x86_64-linux] Error 2
fpcupdeluxe: ERROR: FPCCrossInstaller (BuildModuleCustom: FPC): Running cross compiler fpc make all for x86_64-linux failed with an error code.
fpcupdeluxe: ERROR: FPCCrossInstaller (BuildModuleCustom: FPC): Error running !
fpcupdeluxe: ERROR: Sequencer (FPCBuildOnly): Failure running fpcupdeluxe: error executing sequence FPCBuildOnly; line: 2, param: FPC
fpcupdeluxe: ERROR: Sequencer (Only): Failure running fpcupdeluxe: error executing sequence Only; line: 2, param: FPCBuildOnly


ERROR: Fpcupdeluxe fatal error !
Building cross-tools failed ... ??? ... aborting.

#17 mORMot 1 » Object seralize code » 2017-08-26 09:24:52

wac1104
Replies: 1

this is my open source   project   you can add to Mormot
https://github.com/Ericwang1104/PascalObjectSeralize

Board footer

Powered by FluxBB