Installing EWD’s Realtime Framework on a Cache/Windows System

My earlier posting introduced EWD’s new realtime web framework and described the EWD application that demonstrates all its capabilities.

In this posting, I’ll explain how to get the framework and the example EWD application working with Caché, running on Windows 7.  Just follow the steps below:

1) If you’ve not already done so, follow the instructions in my earlier posting on how to install EWD, Node.js and the ewdGateway2 module.  These steps will install the latest version of EWD so when you’ve completed this step, proceed now to Step 3

2) If, however, you’d already installed EWD, Node.js and the ewdGateway2 module, you’ll need to upgrade EWD as follows:

  • Download EWD from http://www.mgateway.com.  You’ll need to click on the tabs markedEWD/Download EWD/EWD for Caché, then fill out the form.
  • Expand the downloaded zewdxxx.zip file and find the file inside it named zewd.xml.  Copy this to the c:/InterSystems/Cache/Mgr directory (or wherever your Caché Mgr directory resides)
  • Start a Cache Terminal session and type:
  •   zn “%sys”
  •   d import^%zewdAPI()
  • You’ve now updated EWD to the latest build (currently 960).  You can test it’s OK by running the function:
  •   w $$version^%zewdAPI()
  • You should be told the build number of the version of EWD you just installed (eg 960).

3) Now install the very latest ewdGateway2 module using npm (even if you’d followed the instructions for Step 1):

  • Start a Command Prompt window and enter the following commands:
  •    cd \node
  •    npm install ewdgateway2

4) Now move or copy the file c:\node\node_modules\ewdgateway2\examples\ewdStart-cache.js to c:\node

5) Next, we need to get a copy of the realtime web EWD application named ewdGateway2:

  • In a browser, navigate to the ewdGateway2 repository on Github:
  •     https://github.com/robtweed/ewdGateway2
  • Click the Zip button and download the repository as a zip file
  • Open the zip file and navigate to the path ewdGateway2-master/ewdapps
  • Copy the subdirectory named ewdGateway2 from this zip file path into your c:\ewdapps directory: ie you should now have a directory named c:\ewdapps\ewdGateway2 containing the source EWD files for the realtime web application.

6) Compile this new EWD application named ewdGateway2:

  • Open a Cache Terminal session
  • in the “USER” namespace, type:
  •    d compileAll^%zewdAPI(“ewdGateway2″,,”ewd”)   (notice those two commas!)

7) Now move a couple more files:

  • move or copy c:\ewdapps\ewdGateway2\js\ewdGW2.js to c:\node\js
  • move or copy c:\ewdapps\ewdGateway2\node\ewdGW2Mgr.js to c:\node

8) Start a Windows Command Prompt window and start the Node.js ewdGateway2 process:

  •   cd \node
  •   node ewdStart-cache

9) The ewdGateway2 module should now be successfully up and running and listening for incoming HTTP requests on port 8080, so start up a browser and start the EWD application named ewdGateway2:

  http://127.0.0.1:8080/ewd/ewdGateway2/index-cache.ewd

10) The login form should appear against a greyed-out ExtJS layout.  The password iskeepThisSecret!  (This is defined in the file c:\node\ewdStart-cache.js – find the management.password setting.  If you want to change it, edit ewdStart-cache.js and then stop and restart the ewdGateway2 Node.js process.
The ewdGateway2 monitoring/management application should now be running, showing you the latest status of your Node.js-based ewdGateway2 module and its associated child Node.js processes, in addition to the EWD run-time/session environment within the Caché database.  I’ll describe its operation in more detail in a later posting, but for now feel free to explore its many options.  Everything you’ll see changing in the display is happening in real-time, driven by WebSockets messages: there’s no traditional HTTP processing happening at all!

Welcome to the cool and exciting future: realtime web applications!

 

 

 

 

 

 

 

Advertisements

2 comments

  1. Jerry Sicard · · Reply

    Been trying to follow the instructions in this document but there isn’t a
    •Download EWD from http://www.mgateway.com. You’ll need to click on the tabs markedEWD/Download EWD/EWD for Caché, then fill out the form.

    I really need to get this working on a Cache’ Windows environment.

  2. Jerry

    I should probably remove this posting as it is now out of date. For information on EWD.js:

    1) Take the training course at https://www.udemy.com/getting-started-with-ewdjs

    2) Use the latest documentation at http://gradvs1.mgateway.com/download/EWDjs.pdf

    Rob

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: