Genii Weblog


Civility in critiquing the ideas of others is no vice. Rudeness in defending your own ideas is no virtue.


Wed 13 Feb 2019, 04:05 PM
Mix together my last two posts, Formula language in a JavaScript world: JSON db lookups and Choices in your on-the-fly data retrieval, and you get an odd but powerful concoction I have nicknamed @MQRY (Midas Query formulas). All this took to implement was current working code in the Midas C++ API exposed in formula language calls. Consider this the art of the possible. 

Since formula language calls can be made from LotusScript, Java, and Javascript using calls to evaluate, and can also be used in computed text, computed fields, etc, this makes a versatile general query tool. Selection of documents and values can be as broad as across multiple databases and as narrow as retrieving elements from inside rich text, or both at once. In this case, the two calls would return exactly the same data as in my  Choices post.

Would you like to see something like this in Notes/Domino 11? How about in Domino 8.5/9/10/11?


REM {Example of handlng query and retrieval in one call, returning JSON};
json := @DbCommand("MQRY":"NoCache"; 
  @DbName:"SELECT MaintVerNum=\"9.0.1 FP10\""; 
  "SPRnumber,APARID,Client_Server,OfficialDesc,Project,Regression{B},SecurityIssue{B},TRIAGEMODDATE"; 
  "IncludeUNID='Yes' Sort='Yes' Title='SPRNumber' Format='json' JSONFormat='Mongodb' ");


REM {Example of handlng query and retrieval in one call, returning XML};
xml := @DbCommand("MQRY":"NoCache"; 
  @DbName:"SELECT MaintVerNum=\"9.0.1 FP10\""; 
  "SPRnumber,APARID,Client_Server,OfficialDesc,Project,Regression{B},SecurityIssue{B},TRIAGEMODDATE"; 
  "IncludeUNID='Yes' Sort='Yes' Title='SPRNumber' Format='xml' ");


Copyright © 2019 Genii Software Ltd.

Tags:

Wed 13 Feb 2019, 11:08 AM
While it is fun to write about proof-of-concept features, let's talk for a moment about what you can do with the Midas LSX right now, because that is pretty awesome as well. To be clear, the XML option here will be Version 5.60 which is due out any day now, while the JSON and CSV are there now.

Scenario: Collect custom-specified data on-the-fly and return it in various formats

We may want the data returned as a file or as a stream. If we wanted to import the data into some other application, we might use CSV. If we wanted to stream it in a REST API for some other processing, we might return it as JSON. If we want to use it with a webpage generated using XSLT, we might return it as XML.

For this example, let's say we want a few selected fields from every SPR in the FixList db, but only the fixes in Version 9.0.1 FP10. We pass that information in, and in about five lines of LotusScript code, we return the following. I told Midas to sort by SPR to make it easier to read, but usually order doesn't matter in actual applications. Of course, you can try this yourself by requesting a Midas LSX evaluation and using the data-driven sample dbs to avoid coding altogether..



JSON for apps that retrieve and process in JavaScript (e.g., roll-your-own REST API)

Inline JPEG image




XML for apps that use XML for processing (e.g.,with XSLT transformations)

Inline JPEG image



CSV for apps that load data in for processing (e.g., business intelligence visualizations)

Inline JPEG image

Try this and other data retrieval by requesting a Midas LSX evaluation and letting us know what you would like to accomplish.


Copyright © 2019 Genii Software Ltd.

Tags: