OECGI4 and REST


didyouknowoiOne of the upgraded features of OpenInsight 10 will be OECGI4, the newest version of our web support routines.

One of the enhancements to OECGI4 (available as both a Windows executable for Windows web servers, and as a PHP routine for Windows or Linux web servers) is additional support for some of the less well known “verbs” used in the HTTP/HTTPS protocol. When using OECGI to support or access web pages, the HTTP and HTTPS protocols use the “POST” and “GET” verbs to submit, and request, information respectively. These have been in common use since the World Wide Web first standardized on the HTTP/HTTPS protocols. But in addition to the familiar POST and GET, HTTP/HTTPS defines other verbs that can be useful when writing RESTful interfaces.

REST stands for REpresentational State Transfer, and is in a way the underlying principle of the Web. When a client makes an HTTP or HTTPS request from a server, the response from the server contains not only the specific information needed to answer that request, but also details that the client can use to get more information, all “bundled up” in the answer. For example, when a request for a web page is made, the web page may contain images, or stylesheets, or script calls. The client has no way of knowing, in advance, if there is one, or a hundred, images in the returned page – but the page itself contains the instructions the client can use to retrieve the images, or the style sheets, or the script pages. The page may even include the data and instructions needed for the client to retrieve other pages (via links, or via pagination). Because of its familiarity, this may seem simple and straightforward when it comes to web pages, but the concept (that nothing is “predefined”, but rather everything is embodied in the responses) can be expanded upon to make much more advanced inter-operating systems.

REST can be used, not just for retrieving and updating web pages, but also to enable computer programs, as well as people, to interact with web services. By building a RESTful interface, a web service designer opens up their web site to the possibility of having other software query it for information, or update it with changes, thus allowing anyone else to put different user interfaces (if any!) on these interactions. While not required for REST, using HTTP and HTTPS, and the additional HTTP/HTTPS verbs, is currently the most common way of implementing this.

In addition to “POST” and “GET”, HTTP/HTTPS (and OECGI4) support the verbs “PUT”, “DELETE”, and “PATCH.” In the RESTful programming world, the “GET” verb is used to retrieve information – either about the other available interfaces this RESTful interface supports, or information about specific “objects”. For example, if you were to create a customer maintenance web service, the “GET” verb might be used to retrieve the list of customers, or the information about a particular customer – or the list of commands that can be applied to those customer “objects”. The “POST” verb is commonly used to create new “objects” – in our example, the “POST” verb might be used to create a new customer. “PUT” and “PATCH” both are commonly used to update existing “objects” – in our example, either “PUT” or “PATCH” may be used to change the customer’s phone number (PUT may wipe out any data in fields that aren’t specified, while PATCH should only update the specified fields). Finally, “DELETE” is most commonly used to remove “objects”.

When using OECGI4, you can examine the request parameter to find the “request method” (defined in the INET_EQUATES insert), and – with the appropriate INET_XXX stored procedures – you can begin to implement your own web service.

Interested in learning more about RESTful programming? For additional information, please see the following resources:

http://stackoverflow.com/questions/671118/what-exactly-is-restful-programming

http://blog.octo.com/en/design-a-rest-api/

Confusion & Wisdom


oi10tab1
This again is going to be more of a memory for me, but it will still be useful for those of you working with the OpenInsight (OI) 10 Alpha.  I’m a back to working on an application for one of our Value Added Resellers (VAR) and I’ve been trying to build a dynamic toolbar because the system is mostly operated by touch screen operators.

The current menu is three levels deep and the toolbar is limited in space.  I therefore wanted to have a double toolbar with one row of static buttons and a row below which would change depending on which top level button (menu item) is clicked.  The obvious way to achieve this is a panel with a row of buttons and a tab control.

Now the Tab Control in OI 10 is located under the Containers sub category in the Toolbox.  I therefore thought “Great, I’ll drop the buttons on the tab and all will be good.”  However, the current Tab Control has been specifically designed to operate like the current OI9 Tab Control.  This uses paging Forms and you simply drop the controls on the appropriate page, rather than the tab control.  Dropping them onto the Tab Control is actually impossible because it jumps to page one all of the time.  Nevertheless, thinking that the tab control was an intelligent container, I blindly pressed on, getting myself into a state of confusion.

Five minutes later and Carl put me right.  He explained that the current Tab Control has been written to work exactly like the current one so that people’s upgraded applications will not break – that’s the Wisdom and I really glad that Revelation are thinking about supporting existing application, rather than blindly building new controls for new applications.

All I needed to do was:

  1. Drop the tab control on my form and make it shallow so that only the buttons show.
  2. Drop the buttons (or whatever controls) onto the appropriate pages and where I need them to show on the tab control.
  3. Then the bit I was missing.  The buttons will most likely display under the tab control.  So, click on the button, right mouse click and choose ‘Bring to Front’.
  4. Finally, slide the Tab Control over the buttons to contain them – or give the appearance to contain them.
  5. Add the usual tab control code used in OI9 and you are done.

So, what about a brand new tab control that works as a container and that has pagination, or whatever?  Well, don’t hold your breath, but watch this space.

A few minutes later and I have my working dynamic toolbar.  Now I just need to add some glyph images, some code to launch the associated forms and I’m done :D.

 

OpenInsight 10 Presentation Server


OI10white

OpenInsight 10 Features –
OpenInsight 10 Presentation Server

The OpenInsight Presentation Server is a core part of the OpenInsight Development suite.  It hosts the OpenEngine virtual machine and provides Basic+ programs with an object based interface to create and manipulate Windows Desktop Applications.  As well as providing the capability to create your own applications, the Presentation Server also provides the actual OpenInsight development environment itself, which comprises the IDE and its associated tools.

Download a copy of the OpenInsight 10 Presentation Server Reference Manual HERE.

PLEASE NOTE: The OpenInsight 10 Presentation Server Reference Manual is currently a work in progress and is may well change between now and the release of the OI10 final release.

OpenInsight 10 – Alpha 7


OI10whiteRevelation have made some good progress with the OpenInsight 10 Alpha and I’m currently working through my bug list and closing a nice number of reported issues from earlier alphas, something that I’ll continue with over the weekend.

In line with their open and transparent policy for OpenInsight 10, they Alpha v7 is now available for download to all Works Members.

The Alpha v7 is available as a full install. So, if you have worked with earlier alpha’s please use the AppBackup facility to backup your old alpha work and restore it into the new alpha.  This is what I do but one word of warning.  If you keep your data, images and other supporting files in a specific folder (I keep things in C:\RevSoft10.6\MDPmyApp) you’ll need to copy that folder from the earlier alpha and into the new alpha once installed.  The app restore will then use the new folder and the restore should run just fine.

This version includes many enhancements to the IDE, Form Designer, Table Builder and O4W, so it is well worth a look and to take the opportunity to report any issues that you find to Revelation and have those issue addressed before Revelation releases the beta.

OpenInsight for Web (O4W) v2.0, included in the OpenInsight 10 Alpha v7, is a rapid application development tool that lets you generate responsive forms, reports, and dashboards.  Use the powerful GUI drag-and-drop to lay out your forms and then test in both desktop and mobile browser mode. Or use the toolset’s full-function API to create the most sophisticated web pages.

Alpha v7 is set to expire on April 4, 2017.

OI10 Alpha Update


didyouknowoiA few people have recently asked me about the release of the OpenInsight 10 beta and I’m afraid to confirm that the beta will be a few more weeks away BUT I have received a brand new internal alpha, which I hope will be published on the WORKS downloads shortly.

I’ve been working hard with the alpha and I have uploaded a fair number of things for the technical team to look at.  I am pleased to say that the vast majority of these have been responded to and a lot are said to have been addressed in this alpha.  I’ll therefore be working through the alpha to confirm these fixes and then it’ll be back into building my clients application again.

So why this posting?

Well this alpha is more than just fixes and interface enhancements.  It’s a heck of a lot more and something that I have found really exciting because it’s a topic that I have been banging on about for ages – PERFORMANCE.

Several of the team have been working on different areas of OpenInsight to gain better performance.  At conference Mike and Bob spoke about better use of caching and optimised tables as part of the conversion process.  However, recent work with clients around the world and also scheduled code reviews have resulted in much, MUCH more than I had expected.

For example, using memory hash tables and single pass logic, Bob has recently managed to rebuild a 9 million row table in about 10 minutes.  Preliminary tests indicate that OpenInsight 10 is now up to 42% faster than OpenInsight 9.4 at these sort of operations following these changes.  Revelation have indicated to me that users with multiple indexes should see an even bigger jump in performance.  For example, a 9 million row table with five indexes will now only take one pass through the file instead of five passes and thereby give a saving of 40,000,000 reads. 4 x 9,000,000 is 38,000,000 😉 

In addition, Revelation have also reviewed and optimised the ! code to not perform spurious IO operations and index transaction node splits per the Sprezz blog entry here http://sprezzblog.blogspot.co.uk/2009_12_01_archive.html. These changes should eliminate quite a bit of overhead in the system and make index updates faster.

Obviously every application will behave differently but with these and other more general performance enhancements, there really should be some good reasons for end users and developer to want to take a long hard look at OpenInsight 10.

I know that a lot of people have been talking about waiting for a point release, but with these performance enhancements, I’d recommend all OpenInsight developers to begin thinking about their move to OpenInsight 10.  This should begin with a review of Carl’s OpenInsight 10 blog in which he has documented a large number of the interface and code enhancements.  WORKS subscribers can also take a look at the Alpha, although I would wait for the next one and, even then, consider this as a look at what is coming and use it to make plans for your future application conversion and how you might be able to use the interface enhancements in your applications.  This will then put you in a great position to dive into the beta when it comes out and make sure that your needs are catered for with regards to your specific application conversion.

For those interested in such things, the tests noted in this article were undertaken on a Surface 4 running the i7 processor.  The latest OpenInsight 10 alpha was installed with the Universal Driver 5.0 and a real world 9 million row table supplied by one of our customers.

 

OpenInsight 10 Features


Assertions in Basic+

For those of you who have done any Java or C/C++ programming in the past, assertions may be a familiar programming construct.  For those who have not, an assertion is simply a way of embedding tests in your programs to check that a condition is true: if the condition evaluates to false then the program stops to display a message informing you of the failure, and presents a set of choices for dealing with it.

Assertions are basically “sanity checks” that you can employ anywhere in your programs to ensure that the state of your data is as you expect it.  You should use normal error-handling code for errors you expect; you should use assertions for errors that should never occur.

Read On…

Running two instances of OI10


OK, so this posting is more as a reminder for me going forward than anything else.  Last weekend I was working with the OI10 Alpha and I wanted to copy things from one instance of OI10 to another. However, I was blocked because I was only permitted to use one engine and it was being used by the first instance of OI.  I thought that this might have been a restriction but I reported it anyway.

It turns out that this is another setting in the new .rxi file that is used by OpenInsight when first launched.  I have a couple of .rxi files on my system, so the first challenge was to work out which one I needed to change.  This is pretty easy to work out, you just follow these rules:

  1. If the RX switch is used in the shortcut, you’ll use that .rxi file.
  2. If none is defined then OI10 will look for a .rxi file with the same name as the application that you are loading with the /AP switch.
  3. If there is no application defined using the /AP switch, then Oi10 assumes SYSPROG and it’ll use that .rxi file.

So, after a quick check, I’m using SYSPROG, or the SYSPROG.rxi file in my bin32 folder under the OI installation.

I initially guessed that my issue was the <singleInstance> entry which was set to 1, but Carl quickly put me straight and told me that heading will shortly be changed.  In the meantime, he’s told me to look at the <serverName> entry in my .rxi file.  Because I have a serverName set, I am effectively trying to use the same engine as the first instance and Oi behaves correctly and stops the session.  All I need to do is clear the entry by setting it to nothing and then OI will launch as many instances as my license count permits.

Starting OI10 is fully documented in the ‘OpenInsight 10 Presentation Server Object Model’ documentation.  This is a work in progress document that is already into 272 pages but today has been yet another reminder of the numerous options that the guys are exposing to developers when launching OpenInsight.

Consider the .rxi file as a more powerful OInsight.ini file and you won’t go far wrong.  Just don’t do what I did and blindly dive in.  Please take some time to better understand the .rxi files as noted on Carl’s OI10 blog and also in the paperwork when eventually published and released.

For now, I’ll be back into my OI10 Alpha project later today for more learning.