Openlook

From lookoa
Revision as of 06:00, 19 January 2019 by Pascal (talk | contribs) (Monitor OA Jobs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


openlook is Fresche Legacy's (looksoftware) Open Access (OA) offering.
It allows developers to work with RPG Open Access functionality within the newlook Integrated Development Environment (IDE) and
conforms with the Open Access Metadata Open Standard (www.IBMiOA.com).

     The real value of Open Access is to cross technologies without changing technology.
     It is an ideal bridge to combine current IT constraints with future target state.

Contents

Software requirements and prerequisites

The openlook software requirements are:

  • IBMi OS v6.1 and above

IBM i prerequisites

  Idea.png

In January 31, 2012 IBM has announced that the function of Open Access is part of the RPG compiler and no longer dependent on the Rational Open Access: RPG Edition product, 5733-OAR. Then you should already have all the prerequisites on your IBM i with v6+
In any case: The installation of openlook includes a pre-requisite checking process. You can use it to do the checking for you! See section #Testing_pre-requisites


You should have all prerequisite in your system.

For systems not refreshed since 2012 you may check the following: http://lookoa.com/index.php?title=IBM_OA_PTF_before_2012

Installing openlook

Upgrading openlook

(If you unzip from a Mac you may encounter a .zip.cpgz file, in this case, to unzip it properly, open the .zip file with "The Unarchiver" and not the default.)

  • If you have previously installed openlook, to avoid loss of configuration and display-file conversion data when installing a new release execute the following command prior to running the openlook installation:

     DLTLIB LOOKOAOLD
     RNMOBJ OBJ(QSYS/LOOKOA) OBJTYPE(*LIB) NEWOBJ(LOOKOAOLD)

     The backup library will be detected during installation and you will be asked if you wish to restore data.

  • Then follow the same instructions in the -Installing for the first time- section below.


Installing for the first time

Setting up the installation libraries

  • Download LOOKOA.zip from ftp://ftp.looksoftware.com/openlook
  • Extract the installation files (i.e. unzip LOOKOA.zip)
  • Log onto your host with an account with QSECOFR equivalent authority and run CRTSAVF FILE(QGPL/LOOKOA)
  • Use an FTP program of your choice to FTP LOOKOA.SAVF to the IBM i
    • If using Windows you can open a command prompt within the folder containing LOOKOA.SAVF and type in: ftp xxx.xxx.xxx.xxx where xxx.xxx.xxx.xxx is your host's IP
    • Once connected and signed on enter the bin command
    • Transfer the SAVF file using the following command: put lookoa.savf
  • Execute by running the following command:

     RSTLIB SAVLIB(LOOKOA) DEV(*SAVF) SAVF(QGPL/LOOKOA)

Here an illustration of the FTP and restore process:

First in the IBM i :

CRTSAVF QGPL/LOOKOA

Then for example, in the DOS command prompt:

cd c:\...               (navigate to the folder on your pc where you have the unzipped LOOKOA.savf
FTP xxx.xxx.xxx.xxx     (where xxx.xxx.xxx.xxx is the IP of your IBM i)
                        (Connect and sign on )
cd QGPL
bin
put lookoa.savf
quit
exit

Then in the IBM i :

RSTLIB SAVLIB(LOOKOA) DEV(*SAVF) SAVF(QGPL/LOOKOA) 




Esclamativo.png

If this is not the first installation, to avoid possible duplicate files generated by the system with the RSTLIB cmd, run first:
DLTLIB LOOKOA or RNMOBJ OBJ(QSYS/LOOKOA) OBJTYPE(*LIB) NEWOBJ(LOOKOAOLD)


ADD-ON WATSON Translator Web API

Setting up the add-on
This add-on is only available for v7.1+ (This will be used, as an option, by the cmd LOOKOA/TRSLANGDIC)

  • Download WATSONTRS.SAVF from ftp://ftp.looksoftware.com/openlook
  • Log onto your host with an account with QSECOFR equivalent authority and run CRTSAVF FILE(QGPL/WATSONTRS)
  • Use an FTP program of your choice to FTP WATSONTRS.SAVF to the IBM i
    • If using Windows you can open a command prompt within the folder containing WATSONTRS.SAVF and type in: ftp xxx.xxx.xxx.xxx where xxx.xxx.xxx.xxx is your host's IP
    • Once connected and signed on enter the bin command
    • Transfer the SAVF file using the following command: put WATSONTRS.savf
  • Execute by running the following command:

     RSTOBJ OBJ(WATSONTRS) SAVLIB(LOOKOA71) DEV(*SAVF) SAVF(QGPL/WATSONTRS) RSTLIB(LOOKOA)

Starting the installation

Once the installation files are in place you can initiate the installation by running the command:
LOOKOA/INSTALL

The install program will perform various functions including:

  • Present you with a summary of what will be installed
  • Check for pre-requisites e.g. IBM Open Access
  • Provide you with an option of restoring saved data (if upgrading openlook)
  • Prompt for configuration information (HTTP portNumber)
  • Prompt & execute the commands for the openlook installation
  • Provide an option for installing a sample/tutorial program.


Refer to the openlook installation guide (provided with the installation files) for a screen by screen guide to the installation process.


Note: If the library LOOKOADEMO is installed, the demonstration program within it can be used to guide you through your first OA example. It can either be installed via the process above or can be run at any time by running the following command:
      CALL LOOKOA/DEMOINSTAL
      CALL LOOKOADEMO/DEMO

The demonstration installation program will:

  • Present what will be installed
  • Prompt & execute the commands for the demonstration installation
  • Allow for the execution of the demonstration program

The demonstration program will take you through the process of OA enabling a sample RPG application, in this case a Movie catalog program. The same process can be followed with your own applications.

Refer to the openlook installation guide for a screen by screen guide to configuring the demo.

Esclamativo.png

When compiling an OA program ensure that the target release is not V5R4M0, otherwise it won't work!
Check also that your CHGCMDDFT CMD(CRT...) are NOT with TGTRLS(V5R4M0)
The minimum target release is v6.


Licensing openlook

openlook licenses can be applied at the end of the installation by way of the ADDLICKEY command or alternatively they can be applied via the license page within the IDE (via Help | License). If using the ADDLICKEY approach you will need to have pre-existing version (9 or 10) developer or smartclient licenses present.

Set time-out inactivity to clean session storage

With IBM-OA the QINACTITV timer does not take effect because it only acts upon a DSPW job status, no longer applying because OA bypasses the workstation. openlook integrates this function in its installation process and with the cmd LOOKOA/SETINACTIV. (The installation process call the cmd LOOKOA/SETINACTIV)

Esclamativo.png

This setting is mandatory to clean all inactive sessions and all related storage objects created for it.
For any openlook session a set of storage objects is created in the library LOOKOA for the time being of the session.
These objects are DTAQ and USRSPC.
Everything is totally removed & reseted with the cmd LOOOKOA/RESETOA
but the cmd LOOKOA/SETINACTIV will do it automatically in a granular manner.

==> LOOKOA/SETINACTIV
     
                   Set inactive OA job cleaning (SETINACTIV)         
                                                                         
Type choices, press Enter.                                           
                                                                        
Activate (will run every day)  .   *YES          *YES, *NO           
Inactivity timeout in minutes  .   120           Number              
Begin day time (hour)  . . . . .   7             1-23                
End day time (hour)  . . . . . .   23            1-23, 99                
Check every nn minutes . . . . .   30            5-60                
Retain JOBLOG  . . . . . . . . .   *NO           *YES, *NO
Message Queue  . . . . . . . . .   *NONE         Name, *NONE, *USRPRF
  Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB
  
In this example the Checking process for inactive sessions will: 
    Start every day at 07:00:00 and end at 23:00:00
    Check every 30 minutes any sessions that are inactive for more than 120 minutes and kill them with endjob option(*immed)
     
This cmd can be re-run at any time and will have immediate effect (resetting all previous configurations).
 - (1) It will remove any previous scheduled job named LOOKOAINAC.
 - (2) It will remove any previous checking process loop (remove job named LOOKOAINAC in QSYSWRK).
 - (3) It will immediately start a new checking process loop (start a job named LOOKOAINAC in QSYSWRK).
 - (4) It will submit a new scheduled job named LOOKOAINAC with the BEGTIME.  
    The purpose of (4) is to restart (3) every day (in case of IPL etc...).
    
Note: For the parm ENDTIME there is the special value 99. 
  For instance, if your system doesn't stop at night and you choose BEGTIME(1) ENDTIME(23) you will have a gap between 23:00 and 01:00  
  You can use this value 99 for a non-stop checking process loop (3).  
  In any case, the process (4) will refresh (3) using the same attribute.
  
Note: For the parm RTNJOBLOG the value *NO is to avoid the JOBLOG storage in the job LOOKOAINAC in QSYSWRK (3).   
    

You can see the all process in 2 places:

  • In the system scheduled job panel
  • In the Active job under QSYSWRK
In the system scheduled job panel: 
==> WRKJOBSCDE
                                                                   Next    
                         -----Schedule------             Recovery  Submit  
Opt  Job         Status  Date       Time      Frequency   Action   Date    
     LOOKOAINAC   SCD    *ALL       07:00:00  *WEEKLY    *SBMRLS   10/29/17
   
In this example the Checking process for inactive session will (re)start every days at 07:00:00
In the Active job under QSYSWRK:
==> WRKACTJOB SBS(QSYSWRK)
  
QSYSWRK        QSYS        SBS      .0                   DEQW 
  LOOKOAINAC   QPGMR       BCH      .0  DLY-1800         DLYW
       
In this example the Checking process for inactive session will run every 1800 seconds (every 30 minutes).
If you look at the JOBLOG of this job (opt-5 then opt-10 then F10) you will see what has been cleaned up from inactives sessions.
(Note that the JOBLOG will be empty if the parm RTNJOBLOG was *NO in the cmd SETINACTIV)

Storage objects removed by LOOKOA/SETINACTIV

The end result:

  • This checking process will remove any storage objects generated by openlook runtime inactive sessions:
    • All DTAQ in LOOKOA: INP*, OUT*, MKR*, BUF*. MSGID*
      • Details: INPnnnnnn, MKRnnnnnn, OUTXnnnnnn, OUTYnnnnnn, OUTnnnnnn, where nnnnnn represents the job-number
      • Details: BUFrrrrrrr, where rrrrrrr represents a random number for each dspf-format buffer runtime content.
    • All USRSPC in LOOKOA: BUF*, BUI*
      • Details: BUFrrrrrrr, BUIrrrrrrr, where rrrrrrr represents a random number for each dspf-format buffer definition.
  • When you don't have any more active openlook sessions:
    • The only DTAQ you should see in LOOKOA are XTIMEOUT and [SFLOUTQ]
    • No USRSPC

Check parameters configuration of LOOKOA/SETINACTIV

Run the command LOOKOA/CONFIG:

CONFIG      CMD         Display openlook configuration (from SETINACTIV and other settings)

Then roll down the bottom-messages to see all configuration parameters setting for openlook:
===> LOOKOA/CONFIG:
Example of bottom-messages you will see:

Your openlook config is: PORT:8090 ROOT:/www/lookoa/htdocs                   +
Activate cleaning setup for inactive OA jobs: Y                              +
ENDJOB for every Open Access job inactive for more than 00120 minutes.       +
Start checking every day at 07 until 23 and checking done every 30 minutes.  + 
OA Handler Switch Exit Point deactivated.                                    +
Runtime LOGMSG deactivated.

Testing pre-requisites

  • Install the savf LOOKOA (see Installing for the first time section above - only LOOKOA.zip is necessary to test your prerequisites)
  • Run LOOKOA/INSTALL, on the 2nd screen the installer will automatically check for all pre-requisites:


1st screen:

 openlook   looksoftware Open Access solution                      
                                                                   
                                                                   
                                                                   
            openlook installation consist of:                      
                                                                   
                - 1 Library in QSYS: LOOKOA                        
                - 1 Folder  in IFS : www/lookoa/                   
                                                                   
                                                                   
                                                                   
                                                                   
                             Press Enter to proceed                
                                                                   
F3=Exit                                                            

2nd screen:

 openlook   looksoftware Open Access solution                         
                                                                      
                                                                      
                                                                      
                  Prerequisites checking for openlook processing.     
                                                                      
                         - IBM Open Access: OK                        
                                                                      
                                                                      
                                                                      
                                                                      
                           You have all prerequisites                 
                             Press Enter to proceed                   

                                                                      
F3=Exit                                                               

At this point you you can Exit (or continue for a full installation or re-run the command another time).

Enable your application for Open Access with 2 commands

In order to enable your application for Open Access, you will need to run once, at compile time the command CRTDSPFXML to generate an XML definition of your DDS-display. You will then need to run the command CRTROASRC with your RPG source programs and re-compile them. This process should be integrated into your day to day maintenance routine.

CRTDSPFXML

The CRTDSPFXML command generates an XML document for any DDS-display-format on your IFS.

LOOKOA/CRTDSPFXML OBJ(MYLIB/MYDSP)         
                  SRCFILE(*OBJREF/*OBJREF) 
                  SRCMBR(*OBJREF)          
                  TODIR(*DFT)              
                  FROMLANGID(*DSPF)        
                  TOLANGID(*NONE)          
                  GENLANGDIC(*NO)          
                  ENTRYPOINT(*DSPF)        
                  LOGERR(*OUTFILE)         
                  OUTFILE(LOOKOA/OALOGDSP)

The generated XML files will reside in /www/lookoa/htdocs/lookserver/dspfxml/MYLIB/MYDSP/
You can also view and navigate through all the XML files by typing the following URL into your browser: http://n.n.n.n:8090/lookserver/dspfxml/ (where n.n.n.n is the IP of your IBM i).

The CRTDSPFXML command can be optional. If you chose not to run it, openlook will run it for you any time it encounters a display-format for which the XML has not been generated or if the display has changed and CRTDSPFXML has not been re-run (openlook runtime checks the format level id). The DSPF object and DDS source are needed for the cmd CRTDSPFXML, so if your runtime environment doesn't have the DDS source available you may pre-run this cmd first.

Note: The XML generated is the same format as the Open Access Metadata Open Standard supported by IBM and validated by an approval college (Barbara Morris, Tim Rowe, Pascal Polverini, Jon Paris, Vern Hamberg).

  Idea.png

Add a PDM user-defined option or RDp user action: XM - LOOKOA/CRTDSPFXML OBJ(&O/&N)



CRTROASRC

Use this command to OA enable your source member then compile it.

LOOKOA/CRTROASRC FROMFILE(MYLIB/QRPGLESRC) 
                 FROMMBR(MYMEMBER)         
                 TOFILE(*FROMLIB/QRPGOASRC)
                 TOMBR(*FROMMBR)           
                 CRTFILE(*NO)              
                 DEFINE(*NONE)             
                 HSPEC('DFTACTGRP(*NO)')   
                 DEVICE(WORKSTN)           
                 HANDLER(LOOKOA/OAHANDLER) 
                 HANDLERPRC(OAWORKSTN)     
Info.png

When the command has finished, it will, by default, have made a duplicate copy of the original source and added an OA workstation handler spec.
You don’t need to open this new source member, you only have to recompile it. In effect we don’t want you to have a double maintenance.
Then in summary, the way you will operate is (all is explained in this chapter):
- maintain only your original source-member code
- compile it with opt 14 or 15 in yourlib (to get the normal 5250 version)
- use opt OA
- go to QRPGOASRC
- compile it with opt 14 or 15 in yourlibOA (then you only have to put yourlibOA on the top of the *LIBL to get the OA version at runtime)

By default, this command duplicates the original source to another source-file named QRPGOASRC.
If you want it within the same source member you can specify the parm TOFILE(*FROMLIB/*FROMFILE) TOMBR(*FROMMBR)
A good standard to adopt is to create a new library with the same name as the original and a suffix of OA. Run the OA program only by adding this library to the top of your *LIBL.

  Idea.png

Add a PDM user-defined option or RDp user action: OA - LOOKOA/CRTROASRC FROMFILE(&L/&F) FROMMBR(&N)

Note 1: RDp/RDi supports the new F-spec keyword HANDLER however PDM does not. Normally you shouldn't need to edit the RPGOA source code version. If you do need to edit it with PDM however, there is a neat workaround:
The HANDLER keyword will throw a syntax error when you edit the F-spec lines. Disregard this error and continue editing. On the PDM-exit, save the member, ensuring that you select "N" on the ~Return to editing~ PDM option. The compile should be successful.

Note 2: If you want to use the DEFINE option with SQLRPG, the parm DEFINE doesn't exist in the cmd CRTSQLRPGI. You can however use DEFINE in CRTSQLRPGI within the parm COMPILEOPT()
For example:

CRTSQLRPGI OBJ(MYLIB/MYPGM)
           SRCFILE(MYLIB/MYSRC)
           COMPILEOPT('DFTACTGRP(*NO) ACTGRP(*CALLER) DEFINE(USE_DBGTABLE)')


The COMPILEOPT string is appended to the compiler command built by the precompiler. Be aware though that the string is not validated, so make sure the parameter is entered correctly and that you don't use a parameter that's already being passed by the precompiler since the compiler command issues an error if any parameter is incorrect or used more than once.


Compilation summary:

Original source-file
OA source-file
Original compiled object
OA compiled object
 For programs  MYSRCLIB/QRPGLESRC  MYSRCLIB/QRPGOASRC
 (the cmd LOOKOA/CRTROASRC will do it for you)
 MYLIB  MYLIBOA
 (recommended: create a library with the same name as the original and the suffix "OA")
 For displays  MYSRCLIB/QDDSSRC  MYLIB or MYLIB2
 (use the cmd LOOKOA/CRTDSPFXML to generate the XML)
Esclamativo.png

When compiling an OA pgm ensure that the target release is minimum v6! TGTRLS(V6R1M0, V7R1M0...).
otherwise it cannot compile (You will get a smg "Handler keyword not recognised").


Runtime:

 Original Runtime *LIBL 
 OA Runtime *LIBL 
 MYLIB
 [MYLIB2]
 MYLIBOA
 MYLIB
 [MYLIB2]


Global Architecture

Global Architecture











The software is matching “The 3 laws of Softwaristics” (*)
3laws.png
(*) IBM Systems Magazine - The 3 Laws of Softwaristics



Deployment of your OA runtime objects to another system

Next to the normal SAVOBJ, SAVCHGOBJ and RSTOBJ commands for OA-compiled pgm,
you can use the commands LOOKOA/SAVDSPFXML and LOOKOA/RSTDSPFXML to deploy all openlook runtime OA-dspf on another system.
(The OA-dspf are the Open Access enable display-files, i.e. the display-files converted to XML)
No sources nor recompilations will be necessary on the target system.

Info.png

This is particularly handy when your target system doesn't have a compiler.


The 2 commands LOOKOA/SAVDSPFXML and LOOOKOA/RSTDSPFXML are similar to the system commands SAVCHGOBJ and RSTOBJ but specialised for DSPFXML elements.
They are library based, they run with 1 library at a time.
Note: DSPFXML elements are composed of IFS objects and records file on different tables. SAVDSPFXML and RSTDSPFXML insure the correct deployments.


  Idea.png

In summary: With SAVOBJ or SAVCHGOBJ and RSTOBJ you can deploy all Open Access enabled programs.
With LOOKOA/SAVDSPFXML and LOOKOA/RSTDSPFXML you can deploy all Open Access enabled display-files.
Your openlook deployment, from one system to another, is fully integrated.


Example LOOKOA/SAVDSPFXML

LOOKOA/SAVDSFXML
In this example, we save all DSPFXML that were created or changed from a specific DATE.
This will store all necessary elements for deployment in a unique save-file.
The same can be done with generic name 

Note: To know the date format used in your system you can run DSPSYSVAL QDATE
LOOKOA/SAVDSPFXML
A report is always generated along the command SAVDSPFXML:
LOOKOA/SAVDSPFXML Report

Example LOOKOA/RSTDSPFXML

LOOKOA/RSTDSFXML
In this example, we restore all DSPFXML stored in the save-file.
All dspfxml can be restored or only a subset if specific names or a generic name is specified. 

Note: Only save-file issued from LOOKOA/SAVDSPFXML will be valid for the command LOOKOA/RSTDSPFXML. Save-file not issued from LOOKOA/SAVDSPF will generate an error message.
LOOKOA/RSTDSPFXML
A report is always generated along the command RSTDSPFXML:
This report will display the SAVDSPFXML original process and the current RSTDSPFXML process.
LOOKOA/RSTDSPFXML Report 1/2
LOOKOA/RSTDSPFXML Report 2/2


Develop new apps in RPGOA starting from the GUI Designer

openDSPF

For new dev, see this feature in the chapter openDSPF_-_for_new_design

Runtime

5250 & OA are fully compatible and concomitant

With our technology, interactions between 5250 and OA are totally compatible and integrated.
A 5250 pgm can call an OA pgm that can call a 5250 pgm and vice-versa. All will run within the same JOB and same GUI entirely. It is totally transparent for you.
In other words you can run together 5250 pgm with OA-enabled pgm with new-OA (openDSPF) pgm all together within the same JOB and same GUI.
For the 5250 pgms our newlook technology (screen scraping) will run and for OA pgms our openlook technology will run. Both newlook and openlook uses the same integrated runtime & GUI environment.

To note: Both 5250 and OA screens are also integrated in the same Designer IDE. This is one of the strength of our technology: The integration.

Check if you are in OA or not

One easy way if you compile your OA pgm in a specific library (for instance in a lib with the suffix OA as described above) is to use the -Name of library in which the program is located.- from the PSDS (pos 81-90)

DMYPSDS          SDS                 
D CurPgmNam               1     10   
D CurPgmLib              81     90   
  /free
    if CurPgmLib = 'xxxOA'; 
       // we are in OA
    endif;

Or, in a generic way, check any library with prefix = 'OA':

DMYPSDS          SDS                 
D CurPgmNam               1     10   
D CurPgmLib              81     90   
  /free
    if  %subst(CurPgmLib:(%len(%trimr(CurPgmLib))-1):2) = 'OA'; 
       // we are in OA
    endif;

Debug your RPGOAs the same way as your RPGs

All your normal debug commands can be used in the same way to debug your RPGOA with openlook.
You can use interactive debugging in the openlook sessions.


Open LAB

The following step-by-step tutorials are available to guide you through the implementation of various openlook features:

  1. lab1 - RPGOA DOM Control - Add an image and dynamically control its URL from RPG
  2. lab2 - Add an extra SFL column with hidden field
  3. lab3 - RPGOA DOM Control - dynamically control the content of a drop-down list from RPG
  4. lab4 - Display Unicode characters
  5. lab5 - Multitier Multilingual UI Integration
  6. lab6 - OpenDSPF - Build an iphone app
  7. lab7 - OpenDSPF - Design subfile grids side by side
  8. lab8 - OpenDSPF - Deep GUI properties control in RPG


Installing openLAB

The installation of openLAB will take approximately 10 mins.

  • Extract the installation files (i.e. unzip LOOKLAB.zip)
  • Log onto your host with an account with QSECOFR equivalent authority and run CRTSAVF FILE(QGPL/LOOKLAB)
  • Use an FTP program of your choice to FTP LOOKLAB.SAVF to QGPL/LOOKLAB.savf:
    • If using Windows you can open a command prompt with the folder containing LOOKLAB.savf and type in ftp xxx.xxx.xxx.xxx where xxx.xxx.xxx.xxx is your host's IP
    • Once connected and signed on navigate to QGPL.lib and enter the bin command
    • Transfer the SAVF file using the following command: put LOOKLAB.savf
  • Execute by running the following command:

     RSTLIB SAVLIB(LOOKLAB) DEV(*SAVF) SAVF(QGPL/LOOKLAB) MBROPT(*ALL) ALWOBJDIF(*ALL)

Installing Images for openLAB

Some of the openLAB examples require images - these will also need to be downloaded on your IBM i:

  • Download images.zip from ftp://ftp.looksoftware.com/openlook/
  • Extract the image files (i.e. unzip images.zip)
  • Log onto your host with an account with QSECOFR equivalent authority and run

     CRTDIR DIR('/www/lookoa/htdocs/images') DTAAUT(*RWX) OBJAUT(*ALL)
     CRTDIR DIR('/www/lookoa/htdocs/images/wrkmovie') DTAAUT(*RWX) OBJAUT(*ALL)

  • Use an FTP program of your choice to FTP the images folder to the IBMi:


For example, in the command prompt:

cd c:\...               (navigate to the folder on your pc where you have the images folder)
FTP xxx.xxx.xxx.xxx     (where xxx.xxx.xxx.xxx is the IP of your IBM i)
                        (Connect and sign on )
cd /www/lookoa/htdocs/images/wrkmovie
lcd wrkmovie
bin
prompt
mput *.*
quit
exit

Running the LABs


Each LAB has an associated workshop which will guide you through the implementation steps and provide you with additional related information. The workshop PDFs can be downloaded from ftp://ftp.looksoftware.com/openlook/openlook%20LAB/.

To run the labs issue the following command:
 CRTUSRPRF USRPRF(OPENLOOK) INLPGM(LOOKLAB/INI)
Then SIGNON with OPENLOOK Note: You could also run CALL LOOKLAB/INI from a command line.
Two new libraries (LOOK_nnn and LOOK_nnnOA) will be created, they will represent your LAB.

Deleting the LAB libraries


When you have finished experimenting with the LABS you can delete the working lab libraries by issuing the following command:
 WRKLIB LOOK_*
then delete all.

openlook COBOL support

Open Access Handler API


openlook CLP support

see this feature in the chapter #What about CL using SNDRCVF with Open Access?


openlook IASP support

About IASP, referring to the IBM documentation http://www.redbooks.ibm.com/redbooks/pdfs/sg247811.pdf
We can read on page 59:

When attaching a job/thread to an IASP and establishing a library list for the job/thread, it is
important to understand the work management initiation procedure. Subsystem or interactive
job initiation will only search the system ASP for subsystem and job descriptions, classes,
and routing programs. An attempt to place an IASP library in either the QSYSLIBL or
QUSRLIBL will fail. The libraries must be added to the job/thread list using the
INLASPGRP/INLIBLL job description parameter, the SETASPGRP command, or a
combination of the SETASPGRP command and the ADDLIBLE command. 

To set your ASP environment, you will act on your JOBD user-profile LOGIN or initial program and this will continue to work with openlook.

The only point that will need to be customised is the openDSPF View/Show host DataBase navigation feature as openlook uses the IBM i HTTP server.
A global solution would be to change the JOBD of the HTTP instances:

CHGJOBD JOBD(QZHBHTTP/QHTTPSVR)
       INLASPGRP(yourASP)

Blog about our OA solution

Lets meet the RPG Dude!:

  1. http://blog.looksoftware.com/blog/the-ibmi-rpg-dude-design
  2. http://blog.looksoftware.com/blog/the-ibmi-rpg-dude-globalization
  3. http://blog.looksoftware.com/blog/the-ibmi-rpg-dude-integration
  4. http://blog.looksoftware.com/blog/the-ibmi-rpg-dude-open-display-files-drag-and-drop
  5. http://blog.looksoftware.com/blog/the-ibmi-rpg-dude-open-display-files-gui-dom-control
  6. http://blog.looksoftware.com/blog/the-ibmi-rpg-dude-open-display-files-gui-dom-control-0


openlook set of commands

  • All openlook features are command driven. Using the IBM structured standard enables programmatic integration of every function, for any IDE, development and maintenance.
The following lists all the commands in lib LOOKOA:

CONFIG CMD Display openlook configuration (from SETINACTIV and other settings) CRTDSPFXML CMD Create DB and XML from DSPF CRTROASRC CMD Create RPG OA src from RPG ILE - add handler spec DICTOMSGF CMD Copy language dictionary to MSGF (use CHGMSGID) INSTALL CMD Install openlook LOGOA CMD Log OA MSGFTODIC CMD Copy MSGF to language dictionary RESETOA CMD Reset OA runtime RGNDSPFXML CMD Regenerate existing DSPFXML RMVDSPFXML CMD Remove DB and XML from DSPF SAVDSPFXML CMD Save [changed] DSPF XML (for deployment) SETINACTIV CMD Set inactive Jobs cleaning (Similar to QINACTITV) RSTDSPFXML CMD Restore DSPF XML (for deployment) TRSLANGDIC CMD Translate language dictionary (generate multi-lingual & Unicode) UNINSTALL CMD Uninstall openlook VERSION CMD Display openlook version
Runtime setting programs:

Call LOOKOA/GETLANGID PARM('*|jobnbr' langid) Get job OA-langid Call LOOKOA/SETLANGID PARM('*|jobnbr' 'CHS') Set job OA-langid



Top 5 Tips for Display Open Access Design

1. OA + 5250 interaction including break-messages

  • No matter what, systems displays or commands are not OA enable, your architecture has to integrate the 5250 & OA switch in both direction, in the same job and same GUI. This will give you a safety net for any situation and guaranty a solid base for any evolution.

2. DDS keywords covering

  • Empirical testing is the secure answer. For some keyword and combination of keywords, theory is not enough, test and compare always with the 5250.

3. Maintenance of the multi tier architecture

  • OA renders your app multi tier, don't ruin this multi tier with a bad architecture.

4. Openness of your protocols

  • Use open protocol for communication like XML or other markup languages. Technology evolves, if you use open protocols you will be able to continue your evolution without revolution.
  • Use an open standard for metadata representation. All enrichment added to the app cannot be in a proprietary format if you want to insure their sustainability for new devices or interfaces or even new interface providers.

5. Legacy code enhancement and new development within a comprehensive IDE

  • A comprehensive IDE with cross interactions between Designer, DDS and RPG code, will insure a better integrity and production for your day to day maintenance. Don't forget your audience are RPG shops, WISIWIG Designer and RPG code control are the 2 mains pilasters.

--Pascal 09:27, 24 November 2011 (EST)



openlook - Technical values & Business values

Out of the box GUI features


Technical value

Automated recognition:

  • Field types are all recognized and integrated (char, num, date etc..)
  • DATE field type (L) are converted to date-combo
  • DDS keyword VALUES are donverted to drop-down lists or check-boxes
  • DDS keyword RANGE are converted to up-down controls
  • Full subfile grid scalability - More visibility and also handy to sort by column or for Excel exportation

Entire Subfile available for GUI scrolling grid

Note: there are 3 types of sfl-load methods:

# Load-SFL Method
DDS keyword SFLSIZ/SFLPAG
DDS keyword ROLLUP or PAGEDOWN
DDS keyword ROLLDOWN or PAGEUP
Description
Percentage use
Automated scroll with openlook
1
page-at-time
SFLSIZ = SFLPAG
ROLLUP (or pagedown)
ROLLDOWN (or pageup)
The RPG specifically clears the SFL between any pages
10-20 % cases
no
2
self-extracting
SFLSIZ > SFLPAG
ROLLUP (or pagedown)
no rolldown (nor pageup)
The user sees the all SFL
(no need to press ROLLUP)
60-80 % cases
Check mark1.png
3
load-all
SFLSIZ > SFLPAG
no rollup (nor pagedown)
no rolldown (nor pageup)
The user sees the all SFL
10-20 % cases
Check mark1.png


openlook loads the full SFL as needed for both case 2. and 3. i.e for both cases you will get a real vertical scroll-bar.
In other words, as long as you use SFLSIZ>SFLPAG and no ROLLDOWN (nor pageup), you will get the full SFL automatically.
The block size for SFL records load is now working in a complete different scale and you can customize it (see next chapter).
The "order by columns" is an integrated feature of the runtime, so you will be able to do it with the full SFL.
From looksoftware IDE you can also easily add a button to export all in Excel.


Business value
Richer GUI and more visibility to the end user.

Customize the block size for Subfile records load

Set the Global Rule:

Select Rules/Subfiles from Designer IDE
Change the default value for block size and/or select the load all records option

OR/AND Customize a single Subfile Form:

Run your app through the Designer IDE and click on "Designer" button when you are on the SFL screen
Change the value for block size and/or select the load all records option



Subfile XXL "extra-large" - Add extra column in subfile-grid with hidden field


Technical value
With the Designer, select the subfile-grid then select the "columns collection" properties. A list of all subfile field will appear, this list includes hidden fields. Select a hidden field and change its "visible" attribute to "true", add a header with the text property and you are done.

Esclamativo.png

look's client (smartclient, thinclient, IDE) uses a cache for any XML dspf-fmt definition while it runs.
So if you change the DDS, close/re-open all look clients to get the refreshed version.

To change/enhance sound/video track:
Original video-source: ftp://ftp.gu2i.com/wiki_lookoa/addExtraSflColumnsWithHiddenFields.camrec


Esclamativo.png

Run the Open Access (OA) version of your program!
If you use a prefixed library like libxxxOA, insure you have done a ADDLIBLE libxxxOA or that you CALL your pgm in libxxxOA.


Same content as video with step by step slides:


1
launch Designer
look Designer:
Launch Designer from look IDE

2
Select subfile columns collection property
look Designer:
Select the subfile-grid 
then select the Columns collection property 

3
select a hidden field, change its visible attribute to "True"
look Designer:
A list of all subfile-grid fields appears, including hidden fields.
Select a hidden field
then change its Visible attribute to "True".
You can also add a header with the Text attribute

4
New column now visible from a RPG/DDS Hidden field
look Designer:
The new column is now visible.
The same operation can be repeated with any hidden subfile field.


Business value
openlook already offers the entire subfile-grid vertically, overcoming the 5250 page-by-page limit.

Viewing more columns from the subfile-grid or exporting the all grid to Excel will give more visibility to the end-user.

Filtering SFL Hidden fields transmission

If you have Hidden fields in your SFL, they will go through the net and can slow down the transmission if they are many.

There is a global setting to filter them all:

  • Run the following command:
    • LOOKOA/CHGSFLIO SFLHIDLST(*NONE)
  • Then run:
    • LOOKOA/CRTDSPFXML ... for all your display-files having SFL with Hidden fields.

Note: The only drawback is that you won't be able to view any SFL Hidden columns anymore, as described on the previous chapter.

To reset it:

  • Run the following command:
    • LOOKOA/CHGSFLIO SFLHIDLST(*RESET)
  • Then run:
    • LOOKOA/CRTDSPFXML ... for all your display-files having SFL with Hidden fields.


RPG native control of GUI element properties (RPGOA DOM Control)


Technical value
openlook RPGOA DOM Control (Document Object Model) http://en.wikipedia.org/wiki/Document_Object_Model Control (set or get) all GUI properties of any element of the display, like the content of a drop-down list, the view of an image etc... dynamically and directly from your RPG code! More than modernizing only the GUI this is about Modernizing the RPG language.

Rpgoadom.png

All necessary source and object to run this demo are included in openlook installation.

To get or update the installation package, use the FTP site: ftp://ftp.looksoftware.com/openlook/ - Download and install the latest LOOKOA.zip on the IBMi (follow installation guide doc instruction). - Download and install the latest looksoftware90.Interim(...).exe on your PC for the client.
Here all references & sources to run this demo: 
 run:			GO LOOKOADEMO/DEMO  then select  2 - OA-mode
 source DDS:		LOOKOADEMO/QDDSSRC    WRKMOVIE	(see D.O.M. comment) 
 source RPGLE:		LOOKOADEMO/QRPGLESRC  WRKMOVIE	(see D.O.M. comment)
 source RPGOA:		LOOKOADEMO/QRPGOASRC  WRKMOVIE	(see D.O.M. comment)

To use demo images in your system locally: From the FTP site: ftp://ftp.looksoftware.com/openlook/ Download images.zip and install the images folder on your IBMi in: /www/lookoa/htdocs then you will get at the end: /www/lookoa/htdocs/images/
On the RPG LOOKOADEMO/QRPGLESRC WRKMOVIE & LOOKOADEMO/QRPGOASRC WRKMOVIE change the myRoot value as follow: ... c iniPGM begsr * change the IP n.n.n.n with your IBM i IP c eval myRoot = 'http://n.n.n.n:8090' c + '/images/wrkmovie/' ... ... Or use images remotely: c eval myRoot = 'http://www.looksoftware.com/' c + '/lookoa/wrkmovie/' ...

1
image controlled by RPG
look Designer:
Add an image control and name it MOVIMG
DDS: Add a hidden field to contain the address of the image and map it with the GUI
A            MOVIMGVAL    200A  H      TEXT('MAP-O:MOVIMG.Picture')
RPG:
eval MOVIMGVAL = 'www/img/' + MOVIEID + '.png'    
[! use an accessible path for the image, 
in the IFS you can place your images in 
/www/lookoa/htdocs/yourImageDirectoryName/...] 

2
combo-list content controlled by RPG
look Designer:
change legacy field COUNTRY in combo-entry-field 
DDS: Add a hidden field to contain the content of the combo-list and map it with the GUI
A            COUNTRYVAL   200A  H      TEXT('MAP-O:COUNTRY.List')
RPG:
eval COUNTRYVAL = 'United States;United Kingdom;Australia';

3
combo-list content controlled by RPG dynamically
look Designer:
change legacy field CLASSIF in combo-entry-field
DDS: Add a hidden field to contain the content of the combo-list and map it with the GUI
A            CLASSIFVAL   200A  H      TEXT('MAP-O:CLASSIF.List')
RPG: The RPG can change the combo-list content at any I/O
if COUNTRY = 'United States';
   CLASSIFVAL = 'G;PG;PG-13;R;NC-17';
endif;
if COUNTRY = 'United Kingdom';
   CLASSIFVAL  = 'U;PG;12A;12;15;18;R18';
endif;

4
image controlled by RPG dynamically
look Designer:
Add an image control and name it CLAIMG
DDS: Add a hidden field to contain the address of the image and map it with the GUI
A            CLAIMGVAL    200A  H      TEXT('MAP-O:CLAIMG.Picture')
RPG: The RPG can change the image at any I/O
if CLASSIF = 'G';
   CLAIMGVAL = 'G.png';
endif;
if CLASSIF = 'PG';
   CLAIMGVAL = 'PG.png'; 
endif;


Business value
Enrich the GUI directly with RPG and ease Business Logic implementation extension.

Send and Receive generic metadata to your GUI through Hidden fields

On the last chapter we have seen how to map specific GUI properties. There is a another way that can be leveraged to send generic metadata to the GUI that can then be used in runtime macro(s).
The concept is as follow:

  • Add a TextBox in your form with the Designer and make it invisible (uncheck the -visible- property)
  • Add an hidden field in your DDS and map it to the .Text property of the TextBox: TEXT('MAP-O:TEXTBOX1.Text')
  • Control the value of the .Text property via the hidden field in your RPG (At the beginning or every I/O)
  • Use GUI macro(s) to leverage the content of TEXTBOX1.Text


Esclamativo.png

The size limitation per DDS format is 32763 bytes, including all fields (hidden and not hidden). But nothing stop you to write several formats and with openlook you can write formats that only contain hidden fields, they will be seen by the GUI too.


In Designer, add a TextBox and make it invisible In DDS and RPG The metadata value is seen by the GUI inspector therefore available for any macro(s)
GUI TextBox added
In DDS, add a hidden field and map it to the .text property of the TextBox
** To write it from RPG:
METADATAH  500A  H  TEXT('MAP-O:TEXTBOX1.TEXT')

** To read it from RPG:   MAP-I
** To write & read it:    MAP-B


In RPG, control the metadata value (at the beginning or any I/O)

metadatah = 'This is a text metadata'        
          + '<div>'                          
          + 'that can be used for GUI macros'
          + '</div>';
...
if metadatah = 'xxx';
   // action...
endif;
Inspector to view the DOM

Executing dynamic IBM i command from screen Event in the current Job Session

We have a method reserved for application command execution: App.OpenAccess.RunCommand()
Any IBM i command can be executed within the JOB Session, it can be a CALL to another interactive screen, a series of screens or a batch command.
Any command can use parameters and parameters can use contextual values coming from the screen.
Running in the current job session the command will inherit the session library-list and user authority.
When the command is finished (or when you exit the called screen(s)), the session will go back to the initial screen.

The novelty is the capability to run all within the current session, inheriting and leveraging the current app environment and user authority. This will interest any IT actors in our enterprise market as it represents a new and efficient way to merge 2 paradigms, Legacy app and GUI “event”, enabling, for instance, an app navigation to be polymorphic and app services to be invoked from any click.

  Idea.png

Use this feature to navigate in your app, calling any app screens or app services from screen Event like OnClick.


Info.png

This is well known as Reflection Programming Capability. (See next chapter)


1
Add a New Script with Command(s) to be executed in the IBM i (like with QCMDEXC)
Add a New Script with Command(s) to be executed in the IBM i (like with QCMDEXC)

2
Give a Name to your Script page
Give a Name to your Script page

3
Add a function in your Script page that will use App.OpenAccess.RunCommand("...")
Add a function in your Script page that will use App.OpenAccess.RunCommand("..."):
function Call_MYPGM() {
  App.OpenAccess.RunCommand("CALL MYLIB/MYPGM");
}

Add a function with parameters:

function Call_MYPGM() {
   App.OpenAccess.RunCommand("CALL MYLIB/MYPGM PARM('ABC' 12)");
}

Add a function with parameters coming from another GUI screen element:
(See more illustration below in point 5)

function Call_MYPGM2() {
   App.OpenAccess.RunCommand("CALL MYLIB/MYPGM2 PARM('"
   +App.ActiveForm.Controls.TEXTBOX1.Text+ "')");
}

4
On your Form, add an obect that can fire a "OncliClick" Event
On your Form, add an object that can fire a "OnClick" Event:
Set the OnClick event of any GUI object
  1. Select a "Script" page from the combo-list
  2. Add a '.'
  3. Write the Function name
      [ScriptPage].[Function]

OnClick:

   OAcmd.Call_MYPGM

5
ScriptFunction2.png
TextBox1.png
Do the same with a parameter coming from another GUI screen element:
function Call_MYPGM2() {
   App.OpenAccess.RunCommand("CALL MYLIB/MYPGM PARM('"
   +App.ActiveForm.Controls.TEXTBOX1.Text+ "')");
} 

OnClick:

   OAcmd.Call_MYPGM2

6
ScriptFunctionMix.png
Call OA enabled programs, 5250 only, openDSPF

or system command, with parameter(s) or without.

function Call_openDSPF2() {
   App.OpenAccess.RunCommand("CALL MYLIB/OPENDSPF2 PARM('"  
   +App.ActiveForm.Controls.TEXTBOX2.Text+ "')");
} 

function Call_Movie5250() {
   App.OpenAccess.RunCommand("call lookoademo/wrkmovie");
}

function Call_MovieOA() {
   App.OpenAccess.RunCommand("call lookoadeoa/wrkmovie");
} 

function WRKSPLF() {
   App.OpenAccess.RunCommand("WRKSPLF");
} 

function GO_MENU() {
   App.OpenAccess.RunCommand("GO MYLIB/MYMENU");
} 

OnClick:

   OAcmd.Call_openDSPF2
   OAcmd.Call_Movie5250
   OAcmd.Call_MovieOA
   OAcmd.WRKSPLF
   OAcmd.GO_MENU

Reflection Programming Capability

The capability to dynamically run command(s) with dynamic variable(s) opens new possibilities.
These possibilities are what is known as Reflection Programming: Wikipedia Reflection programming

In our case it enables to merge together the RPG core modality, which is sequential, with the GUI & mobile core modality, which is Event driven.
An applicability could be, for instance, to write modules without specfic (hard-coded) code to call each other and leverage this feature to do any call via GUI Event(s).

openDSPF - for new design

You design the screen you want 1st with the look IDE designer, then we generate the XML, DDS and RPG. Here the big steps


1
Create a new host form
look Designer:
Create a new host form

2
Select the format
look Designer:
Select the format

3a
Drag&Drop GUI elements to build your screen
look Designer:
Drag&Drop GUI elements to build your screen

3b
Navigate/select host DataBase for field references
look Designer:
Navigate/select host DataBase 
for field references

3b
Drag&Drop GUI elements and field reference to build your screen
look Designer:
Drag&Drop GUI elements and 
field reference to build your screen.
Notice that the field description is 
going along your field as a label
or column heading

4
Generate your GUI & RPG, specify a library for source and object
look Designer:
Generate your GUI & RPG, specify a library 
for source and object.

To enable access and source+object creation/compilation 
from the Designer IDE you may grant the authority 
of the referenced library and source-file:
GRTOBJAUT OBJ(QSYS/yourLib) OBJTYPE(*LIB) 
 USER(*PUBLIC) AUT(*ALL) 
GRTOBJAUT OBJ(yourLib/QDDSSRC) OBJTYPE(*FILE) 
 USER(*PUBLIC) AUT(*ALL)

For CCSID specific you may first create the QDDSSRC manually:
CRTSRCPF FILE(yourLib/QDDSSRC) CCSID(...)  
GRTOBJAUT OBJ(yourLib/QDDSSRC) OBJTYPE(*FILE) 
 USER(*PUBLIC) AUT(*ALL)
Then use yourLib/QDDSSRC for openDSPF  

4
Your form has been sent to the host and DDS & RPG is generated/compiled
look Designer:
Your Form has been sent to the host 
(in XML following the OA Metadata 
Open Standard www.IBMiOA.com)  
and a DDS & RPG are generated/compiled

5
Here the RPG code generated
look Designer:
Here the RPG code generated (RPGIV or FREE FORM), 
you can directly call it to see the runtime design 
and use it as a template 
to copy in a new source-member 
to add your business logic

6a
Control the DOM
look Designer:
Control the DOM, any property of GUI elements 
directly in RPG.
Notice that this will produce a new Hidden field 
in the DDS as follow:
 A    MYFIELD    100A  H
 A                       TEXT('MAP-O:COMBO1.List')
The same method can be used to enable 
DOM control for legacy pgm. 
The RPG can therefore write/read the property value.

6b
Control the DOM
look Designer:
Control the DOM, any property of GUI elements 
directly in RPG

6b
Here the DDS code generated
look Designer:
Here the DDS code generated

6b
DOM can be controlled by RPG
DOM can be controlled by RPG
look Designer:
All the DOM, 
GUI elements properties, 
can be controlled natively 
by the RPG at every I/O 
(add the property you want 
to control in 6a)

Mobile design example Runtime "as is" example
- the RPG code uses dummy data
to show something already
Runtime "as is" with DB ref example
- the RPG code uses the ref-file
to show something already
iphone form example
runtime example
runtime example

SubFile (SFL) options

A SFL option field (non visible by default) is automatically created for any SubFile.

  • The name of this field is SFLOPT_
  • It is of type CHAR and 10 characters length.


You can configure it in the Designer and control it in your RPG code.


1
Configure the SFL option(s) in the Designer


Render visible the SFL option(s) column
Runtime result with right-click mouse on a SFL row (This will always work, with the SFL option column either visible or not)

2
DDS code
RPG code - (You can comment or remove the dsply code for production)

Handling Error Message

We have a Form property reserved for application error message: App.ActiveForm.Message


1
Add a mapping field for App.ActiveForm.Message
Map to:
App.ActiveForm.Message

2
Set the value of the mapping field to blank or to any message in your logic
RPG code:
Set the value of the mapping field to blank 
or to any message in your logic

3
Display the error message on the Message Bar
look Runtime:
Display the error message on the Message Bar

Use field's definition recognition engine in addition of the GUI engine

Example for JDE: Add button for all promptable field using OA dspf-definition as rules


Technical value
The process uses the DB generated by openlook to filter a list of field with any definition element (name, type, ref, etc..), then add metadata upon them, for instance to render them promptable. This could immediately be used to add "flat" meta-data for the GUI recognition engine (like a '+' on the screen and even on the space-attribute byte) or be enhanced with structured meta-data that could then be directly interpreted by the GUI runtime.

  Idea.png

Use this feature in complement of the GUI recognition engine as another Rules based engine (based on DDS field definition).


1. Create a file to store the FLD-list of your filter:

Create Table yourLib/LISTFLD          
           (                          
                 LIB         char(10),
                 DSP         char(10),
                 FMT         char(10),
                 FLD         char(10) 
           )                

2. Do a simple QUERY as a filter - Select a list of FIELD:

For example, select all field having a name starting with 'PRC':

insert into yourLib/LISTFLD
       select LIB, DSP, FMT, FLD from LOOKOA/OAFLD 
       where FLD like = 'PRC%'
           ...or select all "editable" field (use INPUT or BOTH) being also numeric:
insert into yourLib/LISTFLD 
       select LIB, DSP, FMT, FLD from LOOKOA/OAFLD 
       where FLDUSE = 'I' or FLDUSE = 'B'
       and   FLDTYPCN = 'n'
           ...or select FIELD having the DDS keyword COLOR(RED):
insert into yourLib/LISTFLD 
       select LIB, DSP, FMT, FLD from LOOKOA/OAKWD 
       where KWDFUNCT = 'COLOR' and KWDPARM like '%RED%'
           ...or select label from constants:
insert into yourLib/LISTFLD 
       select LIB, DSP, FMT, FLD from LOOKOA/OAKWD 
       where KWDFUNCT = 'DFT' and KWDPARM like '%Movie%'

3. Add metadata:

ADDLIBLE LOOKOA
ADDLIBLE yourLib
       
Create an RPG to read through your FLD-list and for each field call OAENGINE01 to add metadata:
       
     Program: LOOKOA/OAENGINE01
     parameters: library                  - char(10)
                 dspf                     - char(10)
                 fmt                      - char(10)
                 fld                      - char(10)
                 fld-use-I|O|B            - char(1)
                 'symbol-to-insert'       - char(1)
                 'aft|bef'                - char(3)
       
For example:
CALL PGM(LOOKOA/OAENGINE01)                                      
     PARM(LOOKOADEMO WRKMOVIE ECOPT2 DMOVNAME B '+' 'aft') 
This pgm will add a '+' after the field on the space-attribute byte. (similar pgm can be re-produced for different purpose). 
And the '+' is recognised by looksoftware's product runtime as a promptable field and by default a button 
is added to the right of the field. 

4. RE-Generate the DSPFXML, starting from the openlook DataBase dspf metadata, not re-starting from the original dspf (as this will reset all).

CRTDSPFXML OBJ(LOOKOADEMO/WRKMOVIE)
          ENTRYPOINT(*DB)


Business value
Increase the recognition engine power & enrich the GUI with robots.

openlook tables available for query

______________________________________________________________________________________
LOOKOA/OAFLD
A            LIB           10          TEXT('Library name')           
A            DSP           10          TEXT('Display name')           
A            FMT           10          TEXT('Format name')            
A            FLD           10          TEXT('Field name')             
A            FLDOBUFP       5  0       TEXT('Output buffer position') 
A            FLDIBUFP       5  0       TEXT('Input buffer position')  
A            FLDTYP        10          TEXT('Field type ADF..,const...')
A            FLDTYPCN       1          TEXT('Field type c=char, n=num') 
A            FLDUSE         1          TEXT('Use IOBHPM')               
A            FLDPOSX        5  0       TEXT('Left position')            
A            FLDPOSY        5  0       TEXT('Top position')             
A            FLDSIZX        5  0       TEXT('Length')                   
A            FLDDEC         2  0       TEXT('Dec position')         
A            FLDSIZY        5  0       TEXT('Height')               
A            FLDMSIZX       5  0       TEXT('Max length')           
A            FLDMSIZY       5  0       TEXT('Max height')           
A            FLDIND       290          TEXT('Field indicators cond')
A            FLDRLIB       10          TEXT('Ref lib')              
A            FLDRFIL       10          TEXT('Ref file')             
A            FLDRFMT       10          TEXT('Ref fmt')              
A            FLDRFLD       10          TEXT('Ref field')            
______________________________________________________________________________________
LOOKOA/OAKWD
A            LIB           10          TEXT('Library name')
A            DSP           10          TEXT('Display name')
A            FMT           10          TEXT('Format name') 
A            FLD           10          TEXT('Field name')  
A            KWD           10          TEXT('Key word ID') 
A            KWDPARMC       1          TEXT('Parm continuation')
A            KWDFUNCT      30          TEXT('Function name')       
A            KWDPARM      300          TEXT('Function parameters') 
A            KWDCOND      300          TEXT('Kword condition')       
______________________________________________________________________________________
LOOKOA/OADSP
A            LIB           10          TEXT('Library name')              
A            DSP           10          TEXT('Display name')              
A            DSPTEXT       50          TEXT('Description')               
A            DSPLANGID      7          TEXT('Lang ID')                   
A            DSPDBCSCAP     1          TEXT('DBCS Capable:  N=No, Y=Yes')
A            DSPSTAMP        Z         TEXT('Timestamp')                   
______________________________________________________________________________________
LOOKOA/OAFMT
A            LIB           10          TEXT('Library name')
A            DSP           10          TEXT('Display name')
A            FMT           10          TEXT('Format name')
A            FMTTYP        10          TEXT('Format type')
A            FMTWIN         1          TEXT('Window Y/N')
A            FMTKFRAM      10          TEXT('Kwin or Kfull')
A            FMTMODE        3          TEXT('Mode 80/132')     
A            FMTID         13          TEXT('Format level id') 
A            FMTRECA       10          TEXT('Record associed') 
A            FMTPOSX        5  0       TEXT('Left position')   
A            FMTPOSY        5  0       TEXT('Top position')    
A            FMTSIZX        5  0       TEXT('Length')          
A            FMTSIZY        5  0       TEXT('Height')          
A            FMTMSIZX       5  0       TEXT('Max length')      
A            FMTMSIZY       5  0       TEXT('Max height')      
A            FMTTOPFLD      5  0       TEXT('Top FLD posY')    
A            FMTBOTFLD      5  0       TEXT('Bot FLD posY')



openlook Unicode support for IBM i


Technical value

openlook Unicode support for IBM i
Unicode

Unicode can be integrated in PF, LF, PRTF, DSPF and RPG.
A full Unicode integration is made in all 3 tiers:

  • DB (PF, LF)
  • Business Logic (RPG)
  • UI (PRTF, DSPF)


Usually 5250 cannot integrate Unicode but with openlook it is fully integrated for all 3 tiers.


Get full examples for PF, RPG, DSPF and PRTF (spoolfile/pdf) in the LOOKOADEMO library that is within the installation package (look for any UNICOD* source members or objects).

Business value
Globalization with legacy asset.

Our tools and products to Unicode enable your application

  • X-Analysis and X-Unicode module
  • Newlook and openlook module


openlook Multi-lingual support for IBM i


Technical value

openlook Multi-lingual support for IBM i
PDF document

Multi-lingual Engine batch/interactive

In batch to translate, interactive to switch languages.

How to - quick guide (example to translate your dspf(s) in Chinese (CHS)):

  • LOOKOA/CRTDSPFXML OBJ(YOURDSPF) GENLANGDIC(*YES)
  • LOOKOA/TRSLANGDIC FROMLANGID(ENU) TOLANGID(CHS) WEBSRV(GOOGLE)
    • Google will do a good work, nevertheless you can complete/accomplish the translation by updating the dictionary file LOOKOA/LANGDICT. For instance you can export the dictionary file in Excel for your local translator and then import it when the translation is complete.
    • This feature is also available with IBM WATSON Language Translator: LOOKOA/TRSLANGDIC FROMLANGID(ENU) TOLANGID(CHS) WEBSRV(WATSON)
  • LOOKOA/CRTDSPFXML OBJ(YOURDSPF) TOLANGID(CHS)

Here a simple way to do it:

- Run an example:        
  GO LOOKOADEMO/DEMO
  opt 2
- Generate language dictionary, translate in Chinese and regenerate a Chinese version of the display:
  LOOKOA/CRTDSPFXML OBJ(LOOKOADEMO/WRKMOVIE) GENLANGDIC(*YES)                                          
  LOOKOA/TRSLANGDIC FROMLANGID(ENU) TOLANGID(CHS) WEBSRV(GOOGLE)
  LOOKOA/CRTDSPFXML OBJ(LOOKOADEMO/WRKMOVIE) TOLANGID(CHS)                                   
- Create a user profile with LANGID Chinese:                                                   
  CRTUSRPRF USRPRF(CHINESE) LANGID(CHS)                                                                                                       
- Run the same example in Chinese:
  SIGNON a new session with usrprf CHINESE
  GO LOOKOADEMO/DEMO
  opt 2



If you use MSGF with MSGID/ERRMSGID/SFLMSGID without using any data field &var - Use the option to import them first!!:

  • add the library(ies) of the MSGF(s) of your MSGID/ERRMSGID/SFLMSGID on the library list
  • LOOKOA/CRTDSPFXML OBJ(YOURDSPF) IMPMSGID(*YES) MSGFLIB(*SAME) GENLANGDIC(*YES)
  • LOOKOA/TRSLANGDIC FROMLANGID(ENU) TOLANGID(CHS) WEBSRV(GOOGLE)
  • LOOKOA/CRTDSPFXML OBJ(YOURDSPF) TOLANGID(CHS) IMPMSGID(*YES) MSGFLIB(*SAME)


How to switch languages for the runtime:

  • Use the LANGID attribute of the LOGIN USRPRF to set the language to display.
    • CRTUSRPRF USRPRF(NAME) LANGID(CHS)
  • Use programmatic set/get in your app when you want:
    • callp GETLANGID( '*'|jobnbr : langid ) or CALL LOOKOA/GETLANGID PARM('*|jobnbr' langid)
    • callp SETLANGID( '*'|jobnbr : 'CHS' ) or CALL LOOKOA/SETLANGID PARM('*|jobnbr' 'CHS')
Note
  • With openlook we leverage a multitier architecture and the inherent Unicode capacity of XML documents to define any layout in any languages and to switch them. So we strongly encourage your app to integrate any labels or constants or error messages directly in the DDS as they will end up in XML with our product. In this way any languages translation and integration becomes easier and are 100% covered.
    • If you were using MSGF you can use the parameter IMPMSGID(*YES) from the cmd LOOKOA/CRTDSPFXML to import all in XML (as described above), this will integrate all msg not using data field variable (like &1...).
  • Nevertheless, if you have many messages using data field variable you can still take advantage of the language dictionary. You can copy the messages in the dictionary, translate them, create a new MSGF with a new CCSID corresponding to the new language, duplicate all messages in the new MSGF (cmd MRGMSGF) and then use our command to translate all message in the new MSGF:

Here how to do it:

- Copy all msgid in the dictionary (the dictionary will retain the MSGF & MSGID reference)       
  LOOKOA/MSGFTODIC MSGF(MYLIB/MYMSGF)                                                     
                   MSGFLANGID(ENU)                                                        
                   OMITMSG(*NONE)                                                        
- Translate the dictionary in a new language ID:                                          
  LOOKOA/TRSLANGDIC FROMLANGID(ENU) TOLANGID(CHS) WEBSRV(GOOGLE)                                        
- Create new MSGF for the new language:                                                   
  CRTMSGF MSGF(OTHERLIB/NEWMSGF)                                                          
          TEXT('Message file in Chinese')                                                 
- Merge all from old & new MSGF to duplicate all MSGID:                                   
  MRGMSGF FROMMSGF(MYLIB/MYMSGF)                                                          
          TOMSGF(OTHERLIB/NEWMSGF)                                                        
- Copy all translated text from the dictionary in the new MSGF (CHGMSGD is used under cover):
  LOOKOA/DICTOMSGF FROMMSGF(MYLIB/MYMSGF)                                                 
                   DICLANGID(CHS)                                                         
                   TOMSGF(OTHERLIB/NEWMSGF)                                               
                   CCSID(935)                                                             

Now you have a new MSGF in Chinese that integrates all data field variable (&1...)

Multi-lingual Engine Demo batch/interactive

In batch to translate, interactive to switch languages.
Video Demo 1
Video Demo 2


Business value
Market expansion with legacy asset.

openlook global presentation (doc)


Technical value

To change/enhance sound/video track:
Original video-source: ftp://ftp.gu2i.com/wiki_lookoa/icebergCrescendo.camrec
openlook - The whole Open Access experience
PDF document


Business value
Profitability from legacy and new app development.

openlook and Open Standard


Technical value

openlook - Our approach
Are you comfortable with Open Standard?
looksoftware is leading/working for an Open standard with IBM and all OA ww actors.
Info.png

Here below the link to the Open Access Open Standard Consortium:
http://ibmioa.com

Open Access Metadata Open Standard (OAMOS)


Business value
Investment security.

The use of an open standard distinguishes a product for 2 aspects:

  • it removes lock-in from the end-user perspective.
  • it demonstrates intrinsic added-value of the product features from the vendor perspective.

The consequence of this 2 aspects produces a third aspect:

  • it enables and stimulates switches and interoperabilities between products from both end-user and vendor perspectives.

openlook - from RPG logic to rich multi-devices


Technical value

openlook - from RPG to x devices
Rich re-use, development and deployment with legacy skills.


Rich re-use, development and deployment with legacy resources.


Business value
Rich re-use, development and deployment with legacy skills/resources

Why Open Access and Open Standard are strategic


Technical value

Why Open Access and Open Standard are strategic
openlook integrates a native RPG code control of the DOM on all GUI objects properties


This is about modernizing the RPG language, not only the UI.
RPG OA and Open Standard for DDS in XML makes RPG a top language for modern app.

Open Access and the Metadata Open Standard free the CONTROL and DESCRIPTION to modern UI for RPG. With these new assets and the centrality of RPG with HD, DB, logic control, ILE Architecture, you get a very attractive language. With the same model you can create modern UI and think of RPG as a top modern language.
Esclamativo.png This is a strategic asset.

Info.png

Open Access: https://www.ibm.com/developerworks/mydeveloperworks/wikis/home?lang=en#/wiki/We13116a562db_467e_bcd4_882013aec57a/page/Rational%20Open%20Access.%20RPG%20Edition
Open Access Metadata Open Standard: http://yips.idevcloud.com/oasite/wiki
DOM (Document Object Model): http://en.wikipedia.org/wiki/Document_Object_Model


Business value
No lock-in

Certification

OA metadata open access logo OA metadata open access logo OA metadata open access logo


Press release

The Open Standard for RPG OA Metadata - Published: January 9, 2013 - IBM Systems Magazine: http://ibmsystemsmag.com/ibmi/developer/rpg/oa_standard/



What about CL using SNDRCVF with Open Access?

You can use the API described for COBOL. This API enables I/O OA calls from anywhere.

Bellow the previous solution:
The easiest answer is to convert your CL pgm in RPG.
For CL not doing a lot between 2 SNDRCVF, creating an RPG instead will be fast.

For CL doing a lot what you can do is also:

Leave all "as is" but instead of using the SNDRCVF, call an RPG[OA] to only do the I/O:


The RPG will have a parm for every fields and maybe an extra parm if your CL not only use SNDRCVF but also SNDF and RCVF or if you have multiple display format. The compilation will generate the definition of any fields for both CL and the RPG so you won't need to worry about that but for every DDS indicators your CL is using internally you will need to add a char field in the RPG to move its value into the corresponding RPG/DDS *INnn field (see in03 on the third column below).

CL Before CL After myRPGOA
DCLF myfile

SNDRCVF

if &in03 *eq '1' goto(end)
if &fld01 *eq 'abc' then(do)
...
Enddo
if &fld02 *eq 'abc' then(do)
...
Enddo

 DCLF myfile

 Call myRPGOA parm(&in03 &fld01 &fd02)
 
 if &in03 *eq '1' goto(end)
 if &fld01 *eq 'abc' then(do)
 ...
 Enddo
 if &fld02 *eq 'abc' then(do)
 ...
 Enddo

 Fmyfile                   handler(..)
 
     *entry plist
            Parm       in03    1
            Parm       fld01 
            Parm       fld02
 
            Eval *in03 = in03
 
            Exfmt myRecfmt
 
            Eval in03 = *in03
 
            return
 DCLF myfile

 SNDF

 RCVF

 if &in03 *eq '1' goto(end)
 ... 
 if &in04 *eq '1' then(do)
 ...
 Enddo
 if &fld01 *eq 'abc' then(do)
 ...
 Enddo
 if &fld02 *eq 'abc' then(do)
 ...
 Enddo
 DCLF myfile

 Call myRPGOA parm(&in03 &fld01 &fd02 'SNDF')

 Call myRPGOA parm(&in03 &in04 &fld01 &fd02 'RCVF')

 if &in03 *eq '1' goto(end)
 ... 
 if &in04 *eq '1' then(do)
 ...
 Enddo
 if &fld01 *eq 'abc' then(do)
 ...
 Enddo
 if &fld02 *eq 'abc' then(do)
 ...
 Enddo
 Fmyfile                   handler(..)
 
     *entry plist
            Parm       in03    1
            Parm       in04    1
            Parm       fld01 
            Parm       fld02
            Parm       action  7  
 
            Eval *in03 = ind03
            Eval *in04 = ind04
 
            If action = 'SNDF'
            write myRecfmt;
            elseif action = 'RCVF'
            read myRecfmt
            elseif action = 'SNDRCVF'
            exmt myRecfmt
            endif;
 
            Eval in03 = *ind03
            Eval in04 = *ind04
 
            return

You don't need to pass all DDS-fmt fields but only the ones you explicitly use in your original CL code.


openlook vs newlook

Features
newlook
openlook
looksoftware development IDE (same)
Check mark1.png
Check mark1.png
Runtime thinclient & mobileclient
Check mark1.png
Check mark1.png
Runtime smartclient
Check mark1.png
Check mark1.png
Richer automatic GUI recognition (DDS: VALUES-RANGE-field type/date) - read more...
Check mark1.png
Dynamic RPG DOM Control (img, combo-list content.. controlled by RPG) - read more...
Check mark1.png
SFL vertical extension (automatic full subfile, real vertical scroll-bar) - read more...
Check mark1.png
SFL horizontal extension from RPG (no limit on columns) - read more...
Check mark1.png
Business Logic for core app + GUI centralized & controlled by RPG - read more...
Check mark1.png
Multi-lingual/translation layout - read more...
Check mark1.png
SBCS & DBCS (single & double byte character set)
Check mark1.png
Check mark1.png
Unicode (app globalization) - read more...
Check mark1.png

Note: Any cross-GUI enhancements made with the IDE will both be integrated with newlook and openlook. The IDE and runtime is the same, what can run for both will always be integrated. openlook is an extension based on newlook.

Q & A

Q: Basically what is the handler?

A: Technically the handler takes control of all I/O of your RPG. All RPG code used for display Input/Output like EXFMT, READ, WRITE, READC etc.. bypass the workstation 5250 and are directly monitored by our internal program - the handler - which takes care of the all buffer, data definition, display format and I/O direction towards new channels/GUI/devices.

Q: When a user develops new programs with RPG OA, can he use openlook without DDS?

A: The RPG will always need the buffer definition of all dspf-fields (field type, length and use-I/O/B). This is the same for the display, with in addition the positioning of every field. On the top of this, to construct the screen, RPG + Display will also need some mechanism to overlay different formats or build subfile-grid. Therefore the DDS will always be the most efficient and natural "bridge" to achieve all requirements between RPG and Display. Within our IDE we have the feature to generate the DDS automatically from the Designer: You will be able to create form or grid with the Designer and a DDS will be generated for the RPG compilation. For new dev, see this feature in the chapter openDSPF_-_for_new_design

Q: What happen when a display or RPG has been modified after being converted to OA ?

A: If the RPG program is modified you will need to recompile it. If the Display is modified, the openlook handler recognizes a format-level-id change and re-generate the dspf-XML definition automatically at runtime. The day to day maintenance is as follow:

Change your original RPG-pgm, compile it. Use cmd CRTROASRC to duplicate the source with the Handler spec then you only need to recompile it to another library (we advise to use the same name as the original library with suffix OA. For instance library APP01 becomes APP01OA, then at run-time you will add APP01OA at the top of the *LIBL). ==> You always maintain only 1 source.

Change your DDS-display, compile it. Use cmd CRTDSPFXML, this is preferable but not mandatory, if you forget to do it the openlook handler will do it once at runtime.

Quotes

openlook enables a rich re-use, development and deployment of your IBM i app with legacy skills.
openlook enables a rich re-use, development and deployment of your IBM i app with legacy resources.
Rational Open Access (with openlook) enables customers to develop IBM i for graphical terminals (GUI) without changing the language.
Architecture
A good architecture serves the solution but also provides debugging, maintenance and evolution.
Standard
Open standard remove risks in investment and strip the solution to its real added-value.
Integration
Real IDE integration, drastically raises your productivity. You only realize this when you don’t have it.


Universal rules for a good IT system:
- Multitier Architecture (Open Access)
- Centralization of logical processes (RPG)
- Use of Open Standard (XML)


DDS Keyword support

http://lookoa.com/index.php?title=DDS_Keyword_support

DDS keywords list
After running the command LOOKOA/CRTDSPFXML for all your application library(ies) you can run the following query to list all DDS keywords used in your application:

RUNQRY LOOKOA/DDSKEYWORD

To save the list in a file:
RUNQRY LOOKOA/DDSKEYWORD OUTTYPE(*OUTFILE) OUTFILE(YOURLIB/YOURFILE)

To export the resulting file in Excel:
CPYTOIMPF FROMFILE(YOURLIB/YOURFILE) TOSTMF('/www/lookoa/htdocs/DDSKEYWORD.csv') MBROPT(*REPLACE) FROMCCSID(37) STMFCCSID(819) STMFAUT(*DFT) RCDDLM(*CR) ADDCOLNAM(*SYS)

Then you can FTP /www/lookoa/htdocs/DDSKEYWORD.csv to your PC and open it with Excel.

Note: To install openlook on your IBM i refer chapter Prerequisites (cf. #From_looksoftware)

Debugging

Debugging at runtime

  • You can debug your RPG pgm the same way as in 5250 with STRDBG etc...
  • You can use the command LOOKOA/LOGOA to watch all I/O data from all OA sessions


To add more debug

For information: The global flow is as follow: RPG <--> OA_Handler <--> HTTP_Server <--> Client (Browser, desktop, mobile)

At the Client I/O level

Debug with Newlook runtime client

Edit the properties of 
   Newlook Developer 
or Newlook Enterprise 
or Newlook Smartclient
Add the parameter -dto at the end, add 1 space then -dto, for example:
"...\looksoftware.IDE.exe" -soarchitect looksoftware.IDE.exe" -enterprise -dto
"C:\Program Files (x86)\Newlook 10.3\looksoftware.IDE.exe" -enterprise -dto
"C:\Program Files (x86)\looksoftware 10.1\smartclient.exe" -dto
smartclient properties
apply -dto parameter

Run your application, then see the Input/Output Data trace in C:\ProgramData\looksoftware nn.n\Newlook.trc.
The tracing applies on the first Newlook client connection runtime.
You can open it with notepad++ https://notepad-plus-plus.org/download/ (or with any text editor)

Open 
C:\ProgramData\looksoftware 10.1\Newlook.trc
(...or looksoftware nn.n\Newloook.trc)
Set the language to XML
to ease the view 
of the tracing
Scroll down and see 
real time Job Input/Output 
data transaction
open newlook.trc with notepad++
set language to XML for better visibility
see Input/Output Data for your Job


Any time there is a I/O transaction Newlook.trc is updated (new data increment the current content).
At any time, you can clear the current content of the trace file Newlook.trc: Select all content (Ctrl-A), delete, save.
To stop tracing, remove the parameter -dto on the Newlook client properties

At the HTTP_Server level

1) ==> EDTF '/www/lookoa/conf/httpd.conf' 
   then uncomment the lines as follow:
   #----------errorLog and accessLog ini----------
   #--- Uncomment the following lines           --
   #--- to get Logs in /www/lookoa/apache/logs/ --
    ErrorLog logs/error_log                       
    LogMaint logs/error_log 60 0                  
    LogFormat "%h %l %u %t \"%r\" %>s %b" common  
    CustomLog logs/access_log common              
    LogMaint  logs/access_log 30 0                
    LogLength 512000000                           
   #----------errorLog and accessLog end----------
2) Save, Exit
3) Restart the HTTP server to make effective the change in http.conf:
    ==> LOOKOA/RESETOA
4) Then run the app and replicate the issue.
5) The log to watch:
    Look for the last access_log and last error_log in /www/lookoa/apache/logs/
    ==> wrklnk '/www/lookoa/apache/logs/*'

_____________________________________________________________
Some explanation on LogFormat:
%h = Remote host
%l = Remote logname 
%u = Remote user
%t = Time the request was received
%r = First line of request
%>s = Final Status
%b = Size of response in bytes, excluding HTTP headers
%T = The time taken to serve the request, in seconds.
.
Then you get in access_log:
%h............%l.%u..%t..........................%r.............................................................%>s.%b....%T
192.168.162.8 -  -   05/Nov/2014:15:59:46 +0100§ "GET /LOOKSERVER/webservices/OAGet.php?jobNbr=002698 HTTP/1.1" 200 13393 0
_____________________________________________________________
For information:
For the HTTP, there is 1 access_log and error_log document for each day.
The name of the doc is using the following format: access_log.Q1yymmdd00, error_log.Q1yymmdd00
You can delete all of them, the HTTP server will create new logs doc for every new runtime day.
If you delete logs from the current day, do LOOKOA/RESETOA to makes the HTTP server recreates them.
When finished: 
Re-comment '/www/lookoa/conf/httpd.conf' 
Then restart the HTTP server to make effective the change in http.conf:
==> LOOKOA/RESETOA
Then after you will be able to see all HTTP access:
==> wrklnk '/www/lookoa/apache/logs/*'
You will see a list of log document: 
To see the tracing of HTTP access (if any), enter option 5 on the last access_log.Q1yymmdd00 log-document.
To see the tracing of HTTP error (if any), enter option 5 on the last error_log.Q1yymmdd00 log-document.
You may also see:
cgi_log for the tracing of HTTP-CGI access.
maint.log for the setting of the expiration and size-limit maintenance of all log-documents.

At the OA_Handler I/O level

1) ==> UPDDTA LOOKOA/DEBUG (this is a 1 record file)
   1/0 lookoa/log XMLOUTPUT: 1
   1/0 lookoa/log XMLOUTSFL: 1
   1/0 lookoa/log XMLINPUT:  1
   1/0 lookoa/log GENDDSXML: 1
   1/0 lookoa/log SETOAMODE: 1
   1/0 lookoa/log IO speed:  1
   1/0 waitMsg XMLOUTPUT:    _   
   1/0 waitMsg XMLOUTSFL:    _  
   1/0 waitMsg XMLINPUT:     _ 
   1/0 waitMsg GENDDSXML:    _   
   1/0 waitMsg SETOAMODE:    _ 
2) Save, exit
3) Then run the app and replicate the issue.
4) The log to watch:
    file: LOOKOA/LOG
    ==> runqry qryfile(LOOKOA/LOG) 
    or
    ==> dsppfm LOOKOA/LOG
  Idea.png

You can see the XML data send or received in your browser (from Version v10.6 - 2018-10-02):
1/0 lookoa/log XMLOUTPUT: 1 ...will generate an xml that you can view with the following link: http://yourIBMi_IP:8090/xmlOUTPUT.xml
1/0 lookoa/log XMLOUTSFL: 1 ...will generate an xml that you can view with the following link: http://yourIBMi_IP:8090/xmlOUTSFL.xml
1/0 lookoa/log XMLINPUT: 1 ...will generate an xml that you can view with the following link: http://yourIBMi_IP:8090/xmlINPUT.xml
1/0 lookoa/log GENDDSXML: 1 ...will generate an xml that you can view with the following link: http://yourIBMi_IP:8090/openDSPF.xml

When finished: 
put blank in file LOOKOA/DEBUG or run the command LOOKOA/RESETOA
_____________________________________________________________
For information:
Every time you run LOOKOA/RESETOA the file LOOKOA/DEBUG is cleared automatically.
Then the debug options are all cleared when you run the command LOOKOA/RESETOA.
To clear the file LOOKOA/LOG: 
Run the command LOOKOA/RESETOA then CLRPFM LOOKOA/LOG


OA_Handler I/O trace example

In this example we will show you how to trace the INPUT and OUTPUT xml data received and sent from the client and the host application.
(You will need minimum the Version v10.6 - 2018-10-02 - Check it running the command ==> LOOKOA/VERSION)



*Trace INPUT XML in your browser: your-IBM-i-IP:8090/xmlINPUT.xml

UpddtaDebug for xml-in-out.png UPDDTA LOOKOA/DEBUG


(This is a one record file to contain debugging configuration)


UpddtaDebug 1.png Use an app I/O example for INPUT,


For instance: GO LOOKOADEMO/DEMO, Opt 2


UpddtaDebug 2.png Change an input field and send the change


In our case press F4 to send the INPUT.


UpddtaDebug result xmlinput-xml.png Then you can see now in the Browser the XML input data:


http://yourIBMi_IP:8090/xmlINPUT.xml
If you don't see the XML, check for authority issue: Check log in the app job or http job, related to xmloutput.xml or xmlinput.xml creation in the IFS. The pgm writing the XML is LOOKOA/WRTIFSUTF8. It is compiled with attribute USRPRF(*OWNER) and owner QPGMR, which means the pgm is using QPGMR authority to write into the IFS. The IFS directory in question is /www/lookoa/htdocs. The directory /www/lookoa/htdocs authority attribute should have *RWX to *PUBLIC, if this is not yet the case you should grant it.




*Trace OUTPUT XML in your browser: your-IBM-i-IP:8090/xmlOUTPUT.xml

UpddtaDebug 5.png Use an app I/O example for OUTPUT,


For instance: GO LOOKOADEMO/DEMO, Opt 5


UpddtaDebug 5b.png Send the OUTPUT request


In our case simply press Enter.


UpddtaDebug result xmloutput-xml.png Then you can see in the Browser the XML output data:


http://yourIBMi_IP:8090/xmlOUTPUT.xml
If you don't see the XML, check for authority issue: Check log in the app job or http job, related to xmloutput.xml or xmlinput.xml creation in the IFS. The pgm writing the XML is LOOKOA/WRTIFSUTF8. It is compiled with attribute USRPRF(*OWNER) and owner QPGMR, which means the pgm is using QPGMR authority to write into the IFS. The IFS directory in question is /www/lookoa/htdocs. The directory /www/lookoa/htdocs authority attribute should have *RWX to *PUBLIC, if this is not yet the case you should grant it.


Then reset the debugging configuration file:
CLRPFM LOOKOA/DEBUG

Monitor OA Jobs

Use the command LOOKOA/LOGOA to monitor all openlook jobs.

LOOKOA/LOGOA
From the command LOOKOA/LOGOA the default view is F10=jobInfo.
This view can be filtered by job-number, by inserting it on the top-left field.
On this view we have:
      The job-number (936560)  
      The job-name (QPADEV0001), the user-profile (PASCALP), 
      The user-langid (ENU), the job-langid, that can be changed/set with Call LOOKOA/SETLANGID PARM (ENU),    
      The timestamp of the start of the job-session (2019-01-19 06:48) 
      The timestamp of the last time LOOKOA/SETINACTIV interacted with the job-session(2019-01-19 06:48) 
The available option is: 
      Opt-5 = WRKJOB
The function-keys are:
       F2=iFKey            - shows the last input function-key   
       F5=fmtBuf          - shows the display-format buffer, content and definitions
       F6/F16=oActive  - shows the current active display-formats
       F7=ioSFLchg      - shows the subfile change flag, if active
       F8=SFLreadc     - shows the current subfile readc cursor
       F9=SFLupd        - shows the subfile update
       F10=jobInfo        - shows the job info (which is this view)
       F11=Fold/unfold - unfold 
       F15=LOG            - shows instructions to add log informations
       F24=resetOA     - prompt to reset all OA openlook jobs


Troubleshooting

  Idea.png

For any TROUBLESHOOTING always give a look in the openlook file-log with the following command:
==> DSPPFM LOOKOA/LOG
(OR) ==> RUNQRY QRYFILE((LOOKOA/LOG))
(Openlook runtime tries to add info in the file LOOKOA/LOG as much as possible in case of trouble)

Note for v7.2 a recent PTF is needed: SI54676
Otherwise you will get an HTTP error 500 in binary HTTP
Info.png

Summary of all tracing you may follow when you hit a trouble.

Feedback/report on 1st checking procedure:
runqry qryfile(LOOKOA/LOG)
dspmsg QSYSOPR
wrkoutq qezdebug
wrkoutq qezjoblog
WRKSPLF SELECT(QTMHHTP1)
WRKSPLF SELECT(QTMHHTTP)
Log on Apache: wrklnk '/www/lookoa/apache/logs/*'

Error message logging: Next to the full error message look for the provenience.
JobLog of the RPG job - for any LOOKOA err-msg: Pgm name and line number (F1 then F9 on joblog)
JobLog of the LOOKOA/HTTP job - for any LOOKOA err-msg: Pgm name and line number (F1 then F9 on joblog)

App

  • Multiple write-FMT with ERRMSG and OVRDTA:

If you use the following technique the error message won't appear with OA.

===DDS===
A          R FMT1                                   
A                                      PUTOVR                            
A            FLD1          10   B  5 12                                  
A                                      OVRDTA                            
A  50                                  ERRMSG('My errmsg text')
...
===RPG===
         *in50 = '1';
         write FMT1;
         *in50 = '0';   // in 5250 OVRDTA disables this change, in OA it is effective.
         exfmt FMT1;    // exfmt = write + read

Solution: setoff *in50 only after the EXFMT.

System/HTTP

Primarily check if your network is working:
From a browser, enter the URL of your IBM i as follow (where n.n.n.n is the IP of your IBM i)  
http://n.n.n.n:8090
You should see an index web page, if you don't see anything then check in your network/firewall that the port 8090 is enable.

If you encounter issue you may look for log on the system:

On the HTTP session: Run WRKACTJOB and scroll-down up the QHTTPSVR subsystem or run WRKACTJOB SBS(QHTTPSVR).
Then look at every LOOKOA job as follow:

_  QHTTPSVR
_    LOOKOA       QTMHHTTP    BCH      .0  PGM-QZHBMAIN     SIGW  
_    LOOKOA       QTMHHTTP    BCI      .0  PGM-QZSRLOG      SIGW
_    LOOKOA       QTMHHTTP    BCI      .0  PGM-QZSRHTTP     SIGW
_    LOOKOA       QTMHHTTP    BCI      .0  PGM-QZSRHTTP     DEQW 
_    LOOKOA       QTMHHTP1    BCI      .0  PGM-QZSRCGI      DEQW 	

do option 5 then option 10 against every LOOKOA job to see if you get an error log in one of them.

If you don't see any LOOKOA session, you may run the cmd LOOKOA/RESETOA to clear-cache/restart the IBM i LOOKOA HTTP server (The openlook HTTP server).
To check the openlook HTTP server is restarted you can run the following cmd: WRKACTJOB SBS(QHTTPSVR)
If you don’t see any LOOKOA sessions simply rerun LOOKOA/RESETOA
(it could happens as the endtcpsvr can overlap the strtcpsvr process on the IBM i system)

Or also onto the IBM i apache HTTP server:

wrklnk '/www/lookoa/apache/logs/*'

then look in: cgi_log and look into the last: error_log.Qnnnnnn

Or also look into:

dspmsg QSYSOPR
wrkoutq qezdebug
wrkoutq qezjoblog
WRKSPLF SELECT(QTMHHTP1)
WRKSPLF SELECT(QTMHHTTP)


Some Examples

Error openlook http down.png
HTTP openlook server down (HTTP code 12029)
Run the following command to solve the problem: LOOKOA/RESETOA


Openlook error OAGET websrv.png
HTTP openlook service-program error


Error openlook xmloutput.png
HTTP openlook 2nd level service-program error
Report the errorStatus code.
Run the following command to see the error message: DSPMSGD RANGE(RNQnnnn) MSGF(QRNXMSG) DETAIL(*BASIC) where nnnn = errorStatus
To display our example error: DSPMSGD RANGE(RNQ0102) MSGF(QRNXMSG) DETAIL(*BASIC)


Error http codepage config.png
HTTP code-page EBCDIC-ASCII configuration error
Look in your IFS at /www/lookoa/conf/httpd.conf

Fatal communication error with IIS

Cases:

  • Newlook server - Windows - IIS event id 5011
  • IBMi - QHTTPSVR, PGM-QZSRCGI: CPF9801 Object BUFnnnnnnn in library LOOKOA not found.
  • IBMi - QHTTPSVR, PGM-QZSRCGI: CPF9801 Object INPnnnnnn in library LOOKOA not found.

Insure the timeout set for IIS is less than the timeout set by LOOKOA/SETINACTIV.
For instance, if you set 90 minutes for IIS timeout, set 120 minutes for LOOKOA/SETINACTIV timeout.

CRTDSPFXML Troubleshooting

The command LOOKOA/CRTDSPFXML (library_name/display-file_name) should create, for each format in the display-file:

  • One XML document in the IFS
    • Look in: ==> WRKLNK '/WWW/LOOKOA/HTDOCS/LOOKSERVER/DSPFXML/library_name/display-file_name'
    • or via browser in: http:yourIBMi:8090/lookserver/dspfxml/library_name/display-file_name
  • One record in file LOOKOA/OAFMTURL
    • Look in: ==> RUNQRY QRYFILE((LOOKOA/OAFMTURL))
    • and also 1 rec in file OADSPF, many rec in OAFMT, OAFLD, OAKWD


If any issue occurs:

  • You should get a trace in the LOG file of the command CRTDSPFXML: file LOOKOA/OALOGDSP
    • Look in: ==> RUNQRY QRYFILE((LOOKOA/OALOGDSP))
  • Check in the joblog any authority issue

openDSPF Troubleshooting

Source or Object not created:

4
Generate your GUI & RPG, specify a library for source and object
look Designer:
Generate your GUI & RPG, specify a library 
for source and object.

To enable access and source+object creation/compilation 
from the Designer IDE you may grant the authority 
of the referenced library and source-file:
GRTOBJAUT OBJ(QSYS/yourLib) OBJTYPE(*LIB) 
 USER(*PUBLIC) AUT(*ALL) 
GRTOBJAUT OBJ(yourLib/QDDSSRC) OBJTYPE(*FILE) 
 USER(*PUBLIC) AUT(*ALL)

For CCSID specific you may first create the QDDSSRC manually:
CRTSRCPF FILE(yourLib/QDDSSRC) CCSID(...)  
GRTOBJAUT OBJ(yourLib/QDDSSRC) OBJTYPE(*FILE) 
 USER(*PUBLIC) AUT(*ALL)
Then use yourLib/QDDSSRC for openDSPF  

The Designer IDE uses a default user, check the *PUBLIC authority.
To enable access and source+object creation/compilation from the Designer IDE you may grant the authority of the referenced library and source-file:

GRTOBJAUT OBJ(QSYS/yourLib) OBJTYPE(*LIB) USER(*PUBLIC) AUT(*ALL) 
GRTOBJAUT OBJ(yourLib/QDDSSRC) OBJTYPE(*FILE) USER(*PUBLIC) AUT(*ALL)

If any issue occurs:

  • You should get a trace in the LOG file of the command CRTDSPFXML: file LOOKOA/OALOGDSP
    • Look in: ==> RUNQRY QRYFILE((LOOKOA/OALOGDSP))
  • Check in the joblog any authority issue

Unicode Troubleshooting


Between EBCDIC and Unicode environment it is possible to have undesired residual characters as trailing characters (in the end of the field).
Usually these characters are the "blank" character but formatted in the wrong encoding scheme.

  • You can have (undesired) EBCDIC blanks in a Unicode field or vice-versa.


Here the hexadecimal value of the character "blank" for the different encoding schemes:

  • x’40’ in EBCDIC
  • x’20’ in Unicode UTF-8, ccsid 1208
  • x’0020’ in Unicode UTF-16, ccsid 13488 or 1200


Below a solution to clean it up, in your RPG code:

  • Clean up all trailing EBCDIC "blank" in a variable:
    Var = %trimr(Var:x’40’)
  • Clean up all trailing EBCDIC and UTF8 "blank" in a variable:
    Var = %trimr(Var:x’4020’)
  • Clean up all trailing EBCDIC and UTF8 and UTF16 "blank" in a variable:
    Var = %trimr(Var:x’400020’)

%trimr() reference: https://www.ibm.com/support/knowledgecenter/en/SSPSQF_9.0.0/com.ibm.etools.iseries.langref.doc/evfrilsh891.htm

Clock difference between client and server

You can invoke the following host web service to get the clock difference:

http://n.n.n.n:8090/lookserver/webservices/OATIME.pgm



Did you know ?

  • Did you know that the DOM, Document Object Model is a standard to define GUI methods and attributes on any GUI elements (event, color, img, list-content, etc..)? openlook enables RPG to natively control the DOM.
  • Did you know that with IBM-OA the QINACTITV timer does not take effect because it only acts upon a DSPW job status, no longer applying because OA bypasses the workstation. openlook integrates this function in its installation process and with the cmd LOOKOA/SETINACTIV.
  • Did you know that to enable an app to be multi-lingual sometime this determines the change of the all app, especially if the app is not structurally designed to be multi-lingual (ex: using messages-files). openlook extends the multi-tiers architecture of OA and integrates multi-lingual XML layout for the UI, no changes are needed in your app and languages switches could be driven programmatically or with the user-profile LANGID attribute.
  • Did you know that 5250 or IBM Client Access doesn't support Unicode? openlook fully integrates it and enables scalable implementations.
  • Did you know that with openlook you can debug your OA pgm the same way you debug a 5250 pgm, in the same session and interactively.
  • Did you know that with openlook all is cmd driven: as the IBM structured standard, having features cmd driven enables a programmatic integration of every function, for any IDE, in development and maintenance.
  • Did you know that a subfile can be shared between several programs? A program writes the subfile content and other programs can read or update it. openlook integrates all possibilities
  • Did you know that the 5250 limit on SFL rows and SFL columns visibility also insures a very good UI speed transaction. openlook overcomes SFL vertical and horizontal limits and integrates a new customizable scale for transactions block.
  • Did you know that openlook generates XML definition from your dspf following an open standard (endorsed by IBM + industry) and these XML are accessible to any other of your programs or functions.
  • Did you know that you can’t OA enable without source code - particularly system interfaces. openlook integrates all (OA and non-OA) in the same job/session/UI (even system break messages are naturally integrated in our OA solution).



OA Evaluation process (WIP)

Customer will need;

Hardware 1x IBMi

Software OS v6.1+ openlook (our OA handler) looksoftware site (Latest GA) openlook sample programs

Licenses Looksoftware suite license (temp or perm) openlook license (temp or perm)