Jump to content

Andrea Magni

Members
  • Content Count

    146
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Andrea Magni

  1. Hi, I guess you mean TObjectDictionary<Key,Value> from Generics.Collections... Are you looking for a general solution or you can restrict Key or Value (or both) to some more specific type?
  2. It is just a small addition to MARS Client library capabilities but TMARSClientResourceJSON now implements REST.Client.IRESTResponseJSON interface (from Delphi's REST Client library). This basically means you can use a TMARSClientResourceJSON and materialize a dataset through the TRESTResponseDataSetAdapter component (from Delphi's REST Client library). Enjoy 😉
  3. BTW, I've just updated 10.1 Berlin packages (I am not sure I have VMs for earlier versions). If you are using Berlin, let me know if your problems are now solved. Thanks
  4. @Stuart Clennett, sorry! It's my fault, still need to improve myself in maintaining the library for older Delphi versions... Which one are you using? Thanks @Stefan Glienke
  5. Andrea Magni

    Web dashboard application

    And here is a fresh new (minimal) example of producing a Bootstrap page from a MARS server. The example includes a simple GET call performed through Ajax call. Link: https://github.com/andrea-magni/MARS/tree/master/Demos/Bootstrap HTH
  6. Andrea Magni

    Web dashboard application

    Actually he was looking to keep his VCL app (with data changes notification directly from the db) and add a (responsive) web application. No need to get into the push notification thing. BTW, I noticed I currently have no Boostrap specific example in MARS repository (although I myself have several production projects using this configuration). Will try to add one to the repo ASAP.
  7. Andrea Magni

    Web dashboard application

    Hi Davide, thanks for the quote. Your scenario really suggests for a REST server (whatever library you are going to use: from WebBroker/Datasnap to mORMot, passing through RAD Server as well [if you have an edition including a license]) and a client application (a web app). Obviously I would push for MARS: easy to learn, Delphi oriented, performs well (for maximum scalability and performance I myself would consider mORMot), easy FireDAC integration and support for server side content generation (html, JS or CSS) through dMustache and DelphiRazor libraries. For the frontend there are a number of possibilities. Personally I've done much with jQuery and Bootstrap (easy and effective). If you look for something more high level (components and similar) go for React or Sencha products, but consider the licensing. UniGUI and TMS WebCore are other (commercial) options that can be effective shortcuts to your development time and can help you not to delve too much into web technologies (offering a more stable environment where to work, that is particularly useful for larger or long lasting projects). This is my (possibly biased 🙂 ) idea on the topic. Sincerely
  8. Hi all, anyone here is using TFS for Delphi projects? I never used TFS but one of my newest customers has it as internal standard. Is there IDE plugins or integrations to work with TFS? If not, are there tools for using TFS outside VS? At the moment I am considering installing VS Community and use it just for the versioning stuff but I have no idea how this is feasible / handy... Any suggestion would be greatly appreciated! Thanks Andrea
  9. Andrea Magni

    Microsoft Team Foundation System and Delphi

    Many thanks, I will give it a try! Will let you know if I will be able to use it.
  10. Andrea Magni

    User contributed samples

    Feel free to put up a github repository with your project, I will be happy to review it and I will list your project in a dedicated file in the MARS repository. Sincerely
  11. Andrea Magni

    An elegant open-source calculator for Android

    An easy way to implement formulas is to rely on FireDAC expressions. It is very powerful (I built a simple spreadsheet-like application with very small effort!) Sincerely
  12. Andrea Magni

    Handling MultipartFormData

    Hi, there was no demo showcasing how to handle multipart/form-data on the server side with MARS. But, since a couple of minutes, there is! 🙂 Have a look here: https://github.com/andrea-magni/MARS/tree/master/Demos/MultipartFormData Build and run the demo, then use a browser to navigate http://localhost:8080/rest/default/helloworld/1 to have a simple HTML page with a multipart/form-data form. The last part of the URL can be 1, 2, 3 or 4. On the server side, you will notice four methods marked with the POST attribute, to handle the 4 requests. It is actually the same http request served through 4 different available ways in MARS (see here: https://github.com/andrea-magni/MARS/blob/master/Demos/MultipartFormData/Server.Resources.pas😞 1) ask the library to inject a dynamic array of TFormParam: [FormParams] AParams: TArray<TFormParam> Implementation of the REST method loops on that array to provide a result value; 2) target specific params (by name) using the following syntax: [FormParam('json')] AJSON: TFormParam; [FormParam('image')] AImage: TFormParam; FormParam is defined in MARS.Core.Utils and can represent both simple parameters and files; 3) push a bit more and ask for automatic deserialization of the first parameter into a TJSONObject. The methods has these arguments defined: [FormParam('json'), Consumes(TMediaType.Application_JSON)] AJSON: TJSONObject; [FormParam('image')] AImage: TFormParam; Note the type of the first argument is no more TFormParam but TJSONObject 4) last version takes advantage of JSON to record serialization (built-in with MARS): [FormParam('json'), Consumes(TMediaType.Application_JSON)] ARecord: TPerson; [FormParam('image')] AImage: TFormParam; All these four variations have a TMyResult record as return value. This record gets automatically serialized to JSON by the library. You should be able to build clients in any language (I tested with Postman and the HTML page, using Chrome). Let me know if everything is clear and working. Sincerely, Andrea
  13. Andrea Magni

    fast file searching, what do you recommend, please?

    Give a try to UltraSearch, I use it regularly and it is really good.
  14. Andrea Magni

    Alphabet Index for navigation on ListView?

    Ah, sorry, I didn't get your question right. I would use a second listview probably. The scrolling seems to be independent from your primary list (you might want to do some syncing but seems easy to do). What about this? If you are looking for something more similar to the standard index you get on the right edge of the listview, I would probably go for an extra layer on top of the listview (using a TLayout as a transparent container and probably implementing touch gestures) Nice topic
  15. Andrea Magni

    How to make a component available to all platforms

    A nice hack from @Dalija Prasnikar here: https://stackoverflow.com/questions/27486939/is-there-simpler-way-of-saying-that-delphi-component-control-is-supported-on-all HTH
  16. Andrea Magni

    Alphabet Index for navigation on ListView?

    Hi, is the listview bound to a dataset or manually filled? In the first case I would try to locate the next record in your dataset and have the listview sync'ed automatically. But probably you are in the second case (manually filled list). You can either find a way to build your index while filling the list (a sorted list may be useful here) so that you can let items be shown in the list following one sorting and yet have a second structure where you can find the next item and the corresponding listviewitem (or index). HTH Andrea
  17. In the MARS repository a new demo (check the Demos folder) is now available: https://github.com/andrea-magni/MARS/tree/master/Demos/EKON22 It is a project I created through the MARSCmd utility and used as a playground for my EKON 22 session, yesterday. There are a number of features showcased in this demo, from parameters passing to object/record/dataset serialization passing through FireDAC integration and MARS Client library components. To enable the FireDAC part of the demo, be sure to have a MAIN_DB FireDAC connection defined in your system, against the Firebird demo db (EMPLOYEEDB) or please adapt the simple SQL statements to your own database. I am available for questions or discussion. Sincerely, Andrea
  18. Andrea Magni

    Welcome!

    Welcome in this subgroup dedicated to MARS-Curiosity (MARS in short), a REST Library for Embarcadero Delphi! First of all I want to thank the Delphi Praxis team for the opportunity to have a dedicated subgroup here. MARS is an open source project, at the time I am writing this I am by far the main contributor. The project is hosted on GitHub ( https://github.com/andrea-magni/MARS ). This forum will supersede the G+ community and it is the right place where to ask questions about the project. If you actually find an issue with the library (and it is not a matter of knowing how to achieve something using the library's functionalities), please use the GitHub Issue tracker. Feel free to let me know your opinion about MARS as well as suggest new functionalities or changes in the library. I will be happy to hear from you all. Sincerely, Andrea
  19. Andrea Magni

    Change the background color of a TEdit

    ??? I would really go for customizing the EditStyle (use "Edit Custom Style", beware you might need to do this for each platform you are targeting) and then set the StyleLookup property of your edits accordingly. Doesn't matter then how you decide to customize the style (add a TRectangle, change the style's bitmap, add an effect) and you'll have a consistent behavior as you will be following the DRY principle (one style definition, many edits using it so if you'll ever need to change the visual aspect of your "edit_invalid" style, you'll have a single place to edit and have the change propagated automatically). The other way is to actually manipulate the standard edit style (through some call to FindStyleResource) but that may lead to future issues for example if you'll change the style of your application one day or another (new style, different definition of editstyle). HTH, Andrea
  20. Hi, this is my very first post in this new forum (that I like a lot so far, still learning all functionalities). IIRC recently (Berlin? Tokyo?) some attributes were introduced in order to set a Datasnap method to respond a POST (or PUT) request without having to follow the 'updateXXX' naming convention... I was looking for a reference this morning but could not find it. Anyone can lend me a link or an example? Thanks in advance, Andrea
×