demoapp
About This Space
Demo application for Profound.js
Last updated on July 17, 2024
Public Permissions: View Run Comment
Profound.js Example Application
Before setting up the Node.js modules on IBM i, we suggest you try setting up and running this application from your own machine first.
References
- Profound.js Overview
- Installing Prerequisites, Installing Profound.js, Verifying the Installation
- Setting Up Genie on IBM i (how to access Genie & PJSMYIP)
- Calling Node.js Modules via Proxy Programs
- Profound.js Debugging with VS Code
Setup
Follow these instructions after you have cloned the repository.
ILE setup
You will need to copy both ILE/INQ05R.rpgle
and ILE/INQ05D.dspf
into a source-physical file on IBM i:
> CRTSRCPF FILE(YOURAPP/QRPGLESRC) RCDLEN(112)
> CRTSRCPF FILE(YOURAPP/QDDSSRC) RCDLEN(112)
> CPYFRMSTMF FROMSTMF('ILE/INQ05R.rpgle') TOMBR('/QSYS.lib/YOURAPP.lib/QRPGLESRC.file/INQ05R.mbr') MBROPT(*ADD)
> CPYFRMSTMF FROMSTMF('ILE/INQ05D.dspf') TOMBR('/QSYS.lib/YOURAPP.lib/QRPGLESRC.file/INQ05D.mbr') MBROPT(*ADD)
You must also create the tables used by the programs in this example on IBM i:
> RUNSQLSTM SRCSTMF('ILE/productsp.sql') COMMIT(*NONE) NAMING(*SQL)
> RUNSQLSTM SRCSTMF('ILE/products1l.sql') COMMIT(*NONE) NAMING(*SQL)
> RUNSQLSTM SRCSTMF('ILE/products2l.sql') COMMIT(*NONE) NAMING(*SQL)
> RUNSQLSTM SRCSTMF('ILE/prodfeatp.sql') COMMIT(*NONE) NAMING(*SQL)
> RUNSQLSTM SRCSTMF('ILE/featuresp.sql') COMMIT(*NONE) NAMING(*SQL)
> RUNSQLSTM SRCSTMF('ILE/categp.sql') COMMIT(*NONE) NAMING(*SQL)
> RUNSQLSTM SRCSTMF('ILE/orders.sql') COMMIT(*NONE) NAMING(*SQL)
Next, you must
- compile the Rich Display file (
INQ05D
) from the Profound UI Designer. - compile the RPG program (INQ05R) using
CRTBNDRPG PGM(YOURAPP/INQ05R) SRCFILE(YOURAPP/QRPGLESRC)
. For debugging reasons, you could also use theOPTION(*EVENTF) DBGVIEW(*SOURCE)
parameters. - create the proxy object for the PRODDSP Node.js module using
CRTPJSPRXY PGM(YOURAPP/PRODDSP)
Node.js setup
Before you start the Profound.js server, you need to install all the package dependancies.
cd c:\pjsinstall
- change this depending on where you install Profound.jsnpm install
- this will fetch all the required packages.node updatepui
- this will download a copy of the htdocs for you.
Running the application
If you're running Profound.js on your own machine that is not IBM i, you must use the PJSMYIP
command to point all Profound.js requests to your local machine.
- Start your Profound.js server (If you're running on your own machine:
node start
) - From Genie:
CALL INQ05R
- This program,
INQ05R
, is the RPG application that callsPRODDSP
. - When selecting on a product from the list on the left of the display, it will call
PRODDSP
which is the Node.js application.
Be the first to comment:
Comments