#2 Re: mORMot 1 » Node.js client to IServiceWithCallbackReleased » 2019-01-11 08:38:34

Sorry about the spam smile

I found out why the Delphinus version is so old. According to the docs https://github.com/Memnarch/Delphinus/w … ur-package, it installs the latest release tag, which in mormot's case is 1.18.2975, from Sep 2016.
If there are no releases, it installs the latest commit.

If you don't plan to tag releases often, I will just install from the repo manually.

Vladimir wrote:

My version is 1.18.2975, installed automatically with the Delphinus plugin. While the latest one on Github is 1.18.4951.

Doesn't Delphinus install the latest that is found in Github? Should I not use it to install mormot if it falls behind?

#3 Re: mORMot 1 » Node.js client to IServiceWithCallbackReleased » 2019-01-11 08:15:31

Never mind. After a more careful look at the github commit history, it turned out that my copy of the repo is older and does not have the necessary methods. The example seems correct.

My version is 1.18.2975, installed automatically with the Delphinus plugin. While the latest one on Github is 1.18.4951.

Doesn't Delphinus install the latest that is found in Github? Should I not use it to install mormot if it falls behind?

#4 Re: mORMot 1 » Node.js client to IServiceWithCallbackReleased » 2019-01-11 07:26:29

Hello Arnaud

I was looking at the Synopse Websockets implementation in SynbidirSock, because I need a Winsockets Client that could connect to a standard external winsockets server, not an interface based one.
The Project31SimpleEchoServer project shows how to make a server with a custom protocol, but not a client.

I found this topic, but it seems that the class implementations have changed since you posted the example. WebSocketsUpgrade does not accept a custom protocol, there are no such methods "ws.WebSockets.Outgoing.Push(frame)", etc.

Can you tell me how to make a client with a custom protocol, e.g the TWebSocketProtocolChat protocol?
And what would be the recommended way to send a frame from this client? I saw that TWebSocketProcess has a SendFrame method, but it is protected. Should I override it in my own class or what?

Thanks in advance.
Vladimir

ab wrote:

This sample is a not standard WebSockets client or server.
To define a Delphi Client of a node.js on the other end, as server, you need just the raw WebSocket / json protocol.
Something like this to connect to aNodeServer:aNodePort/aNodeURI with aNodeProtocol:

      ws := THttpClientWebSockets.Create;
      try
        ws.Open(aNodeServer, aNodePort);
        info := ws.WebSocketsUpgrade(aNodeUri, '', false, false,
          TWebSocketProtocolChat.Create(aNodeProtocol, '', OnIncomingFrame));
        // see OnIncomingFrame below
        assert(info = '');
       ....
       // to send a frame asynchrously:
       ws.WebSockets.Outgoing.Push(frame);
       ....
       finally
          ws.Free;
      end;

#5 Re: mORMot 1 » Advice for 3-tier doc storage based on Mongo » 2018-03-23 13:19:52

Thanks for the pointers. I will read some more and will experiment with FPC, the Linux daemon and the overall structure. Probably more questions will come up in the process smile

#6 mORMot 1 » Advice for 3-tier doc storage based on Mongo » 2018-03-21 10:02:06

Vladimir
Replies: 2

Hello

I need some general advice for a new app that I am building. The rough functionality it will have is this:
- store documents without a completely fixed structure. There will be a few document types that will have common fields (like number, date, description, etc) and other data structures that will not be fixed and will be different in each doc.
- store scanned files that are related to each document, but they will not be in the DB
- of course various text searches in the documents, most likely in the fixed structure data
- not a big database, probably not more than 5-10000 docs/year and 5-10 users.

Based on that, I decided to try mORMot together with MongoDB, mostly because Mongo seems suitable exactly for the doc storage without a fixed structure. I saw that with mORMot I could use an RDBMS and TDocVariant to store the unstructured data, but the Mongo ODM approach sounds better.

I made a quick test with a rich client connected to MongoDB directly with SynMongo and it worked well. However, the plan is to make a 3-tier structure like:
- MongoDB for storage of the data, as well as direct file storage of the scanned files
- An app server that will handle the logic, doc and file storage, and provide APIs for several clients. This will likely run on the same machine as the MongoDB, which will likely be Linux.
- A Windows desktop client written in Delphi. It will expose the full functionality of the API for managing the data
- An Android client that will be simpler and used mostly for viewing data. Written probably in Delphi or React Native.

This all sounds good to me, but since I don't have too much experience with Mongo or mORMot and 3-tier, I would be happy to hear some opinions about the concept.
1) Would Mongo/ODM have any advantages over the more traditional approach of SqLite/ORM combined with some TDocVariant fields for storing the unstructured data, considering that the database will not be very large? I think that the search will be harder in the SqLite/TDocVariant case.
2) mORMot is not compatible with the Delphi Linux compiler, right? So I suppose that I would have to use FPC for the app server on Linux.
3) What would be the best way to do the client-server communication for the Android and the Delphi client? Are there any samples that demonstrate either or both?
4) Would there be any advantage or disadvantage regarding the client-server API if I write the mobile client in Delphi or in React Native?
5) Any other samples that will be relative to a similar 3-tier architecture? The SynFile demo seems a good candidate.

The questions are very broad of course without the full specifications, but I would be happy to hear your opinions, even if they are subjective smile

Thanks in advance.

#7 Re: mORMot 1 » TMS DBGrid doesn't show all records from TSynVirtualDataSet » 2018-01-31 15:37:18

Thanks, linking it with ToClientDataSet shows all the data. But what does that mean regarding the TDataSet, why it doesn't work with it?

I don't see a similar Mongo related function.
Well, I guess that I could convert the variant array to JSON and then to a TClientDataSet with JSONToClientDataSet. Its a couple of lines and it should work, but it's a lot of copying of data.

#8 mORMot 1 » TMS DBGrid doesn't show all records from TSynVirtualDataSet » 2018-01-31 13:20:45

Vladimir
Replies: 2

Hello

I'm experimenting with the Mongo driver part of Mormot. For easy data visualization I wanted to connect a DB grid (TMS TDbAdvGrid actually) through a data set to a Mongo collection. It seems to be very simple with the TSynVirtualDataSet classes, but the problem is that the grid only shows the first record.
The connection is done like this:

var
  Docs: TVariantDynArray;
begin
  fDocsColl.FindDocs(Docs, null);
  TmsGrid.DataSet := ToDataSet(Self, Docs, [], []);
...

Now, this might not be a limitation in the mOMot code, because the standard TDBGrid works properly and shows all the records. The TMS one doesn't. The Docs array contains all the records so the query works.
However, the TMS grid so far has been working with all datasets and this is the first time I have seen this issue.

So I wonder if some methods might be needed that are not implemented in the mORMot TDataSet descendant? The TMS grid has properties for working with paged and sequential/non-sequential datasets, but they don't fix the problem.

Any ideas what the cause could be?
Thanks

#9 Re: Other components » SynCrypto for OSX? » 2012-12-31 11:58:09

Just for information if someone else is interested... I compiled the SynCrypto for OSX with Delphi XE3 with only a few minor modifications. I had to remove the SynCommons from the uses clause and copy 4-5 of the types from it to the SynCrypto. Also undefined the USETHREADS... define because it uses the Windows threads API so this part can not be compiled without major modifications.

The AES cipher works very well and gives quite good speeds compared to other two implementations I tried.

There was a problem when I added SynCrypto to the uses clause of a sandboxed OSX app. The app closes itself immediately after it is ran without any crash report or notice. There was no need to actually call any method from the SynCrypto, but only add it to the Uses.
I didn't debug that though because it didn't matter for me at the moment.

#10 Other components » SynCrypto for OSX? » 2012-12-21 11:59:20

Vladimir
Replies: 2

Hello

I am interested in a simple AES implementation and found the synCrypto unit. I saw some defines in it for Linux and Windows. Can it be compiled for OSX also with DelphiXE2-XE3?

There were come calls to Windows threads API, but if they are not vital for the library I guess it should compile... If I am allowed to do some changes in the code of course.

Thanks
Vladimir

Board footer

Powered by FluxBB