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/

Advertisements

SRP HTTP Framework – Create REST APIs for OpenInsight


srphttpframeworkThere has been a lot of talk about REST and Restful APIs in recent months.  Don spoke about SRP’s use of RESTful APIs in his conference presentation last year and I noticed that other MultiValue vendors are starting to support the technology – it’s seems to have now moved beyond the latest must have.

In addition to SRP’s pre-conference blog posting RESTing before RevCon 2016, SRP have just published a follow-up blog article which talks about why they released their SRP HTTP Framework and also about their new version of the toolset (Version 3).

You can read the full blog article on their blog – here.  If nothing more, the postings and the Powerpoint presentation will give you a good grounding for the technology and how it can be exploited in OpenInsight.  You won’t be caught out when providing a demo and you are asked about support for REST and what it might mean for you and your application.

OpenInsight Crashing and Not Responding Issues.


We have recently received a number of support requests from clients reporting that OpenInsight has stopped responding or OpenInsight has stopped working and crashed.  This is sometimes the message that OpenInsight has stopped working because it is addressing illegal memory, or that OpenInsight has stopped responding and you can opt to close it, ask Windows to correct it or carry on waiting for a close.  On further questioning, we sometimes find that there is an associated FS1030 or and FS231 error message.

In 99% of cases, the issue is the result of something environmental or that the UD has been incorrectly installed or some has changed something on the network, such as replacing the server and not reinstalling the UD correctly.

If you should be faced with an issue such as those above, we recommend that you thoroughly check the Universal Driver installation and even uninstall and reinstall the Universal Driver, whilst ‘closely’ following the installation manual.  We also suggest that you check for DEP running on the system because this also causes issues on older OpenInsight based systems.

However, below are a few specific things to consider:

  • FS1030 – This is usually a result of the SYSTEM USER either not being configured correctly with full permissions during the installation, or someone has decided to delete the user.  The latter is common where a server administrator (or outside IT contractor) is running a user audit and removing old users.  They don’t recognise the SYSTEM user or don’t understand the significance and simply delete it as no longer needed, or reset the SYSTEM user with restricted permissions.

 

  • FS231 – This error message is often attributable to an issue within the REVPARAM file, or where the REVPARAM file has been deleted or created with an extension, such as .txt.  One of the most common configuration issues is the SERVERNAME= parameter in the REVPARAM file not matching the name in the registry that was input during the installation wizard.  Sometimes, if you try to run the UD Manager that will fail with an FS231 error message, this is often a result of the servername being incorrect in the UD Manager’s REVPARAM file.

 

  • FS1019 – New server and workstation deployments often contain default firewall rules that block OpenInsight from communicating with the Linear Hash service on the server.  When this occurs a FS1019 or similar message will appear during OpenInsight start-up.  Revelation have published a white paper (knowledgebase article) on this issue and an accompanying Port Checker.  Both are available on request or from http://www.revelation.com/o4wtrs/KB_Articles/KB0269.htm.

 

  • OpenInsight Is Not Responding – This message often shows in the top of the OpenInsight window or in a message.  Three options are offered and one is to allow the program to run until completed. OpenInsight is actually working but the Operating System, often Windows 7 or later, thinks that it has stopped responding because OpenInsight is busy and not ‘currently’ communicating with the Operating System for a time.  Often waiting for the OpenInsight process to complete will result in the message closing itself (or going away) and everything returns to normal.  Some likely causes could be a resize or creation of a large file or a large indexing run. If this becomes an issue for users, it is often necessary to identify which process is taking the time and then to add some code to let the Operating System know that OpenInsight is working.

 

  • OpenInsight has stopped working and Will Close – This is a more serious issue because the operating system will forcibly close down OpenInsight.  We have recently experienced that running OpenInsight with a profile log eradicates this issue and that OpenInsight again crashes when the log is removed.  This has been an issue invoked by the driver in NETDRV being incorrect.  One recent installation of the Universal Driver 4.7.2 was being run with the UD 4.6 driver set in OpenInsight.  This was because the 4.7.2 driver was not amongst the options in NETDRV.  We completed the Universal Driver installation correctly by running the UD Client Install and the system immediately began to run correctly.  If you experience ‘any’ OpenInsight crashing or not responding messages, we would advise that the client driver is checked and make sure that the UD and the client are running as a pair – i.e. 4.7.2 server and 4.7.2 client.

Sprezzatura have a useful blog article which discusses the OpenInsight Not Responding issue in much more detail.  Click Here for the SENL article.

Of course, if none of the above help to eradicate your networking or OpenInsight crashing issue, please contact your local Revelation support person and they will be happy to investigate the issue further.

Finally, if you are running an older version of the Universal Driver, please consider an upgrade to version 4.7.2 which has some important enhancements, including a memory leak fix.  The upgrade from 4.0 is free and your local Revelation representative will be happy to process the supply of the upgrade for you.

Alternative Method to Maintain Indices Or Any Other Repetitive Processes


If your site is running an engine server, you can take advantage of the built-in “System Monitor” feature to automate regular processes such as index updates.  If you edit, with notepad or similar application, your engine server’s configuration file (normally eserver.cfg, located in your OpenInsight folder), you may find a line that starts:

System Monitor=

Following the equal sign, you can specify the process you want to run, along with the application, user name, and password where the process should be run (comma-delimited).  Multiple processes my be specified, separated by semi-colons.

You can find out more about this useful OpenInsight feature in the OpenInsight Knowledgebase or by simply clicking here.

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…

Understanding the Linear Hash SIZELOCK parameter and Best Practice Usage


The sizelock parameter is used to control the automatic resizing of the primary address space.  A sizelock of “0” indicates that a table should be allowed to expand as more rows are entered, and become smaller as rows are deleted.  A sizelock of “1” indicates that a table should be allowed to expand, but should not become smaller.  This is useful in cases of a presized table, when a preliminary expectation is for the table to hold 1000 rows, but more rows may be added.  If a sizelock is set to “2” or more, the table is not allowed to expand or contract.  A sizelock of “2” is very important during a select operation executed on a network, when one user is searching a table for information while another user is entering new data.

Read On...

TRACKINGSIZE


This one is more of a reminder to myself for when I take another look at my CRM system interface in a few weeks time but whilst working on a clients interface (a personal project), I needed to set the size of my MDIChild windows.

I’d set the option to Window’s ‘Frame’ option to ‘Thin’ and it displays just fine in test mode when the window runs on its own.  However, Windows overrides this when it is run as an MDIChild window and the frame becomes thick and the window is therefore sizeable.

I search around for a solution but needed the help of our resident OI Guru (thanks Carl) to point me in the right direction.  The cursor still displays with the arrows over the frame but I’ll look at that later.  For now, the code below (lifted straight form the OI help files) sorts me out just fine.

*/ -----------------------------------------------------------------------------
*/ 16/09/2016 - MDP
*/ Set the frame to not allow the users to change the size

    CurSize = Get_Property(@Window, "SIZE")

    MinW = CurSize<3>
    MinH = CurSize<4>
    MaxW = CurSize<3>
    MaxH = CurSize<4>

    x = Set_Property(@Window,"TRACKINGSIZE",MinW:@FM:MinH:@FM:MaxW:@FM:MaxH)

*/ -----------------------------------------------------------------------------

RETURN 0