Page 2 of 3
Re: Universal PUIMAPP Question
Posted: Tue Nov 18, 2014 7:02 pm
by Scott Klement
Add an H-spec with the PROFOUNDUI binding directory.
Re: Universal PUIMAPP Question
Posted: Wed Nov 19, 2014 10:49 am
by emhill
Scott,
Still having a problem using the SYNCJOB(*NO). I added the H spec for the BNDDIR and then added the SYNCJOB(*NO) before I opened any files. I don't get errors but my dropdown is not populated. If I remove the SYNCJOB(*NO) and use my ADDLIBLE system commands to add the libraries, all works great. I have to be missing something else. I know the SYNCJOB(*NO) works because we have used it in numerous RPGsp programs.
Here is the code using the SYNCJOB(*NO). Notice the commented out ADDLIBLE commands. When those are used all works well.
Code: Select all
H DFTACTGRP(*NO) ACTGRP(*NEW)
H BNDDIR('PROFOUNDUI')
FUNVBRF CF E WorkStn Handler('UNIVERSAL(HANDLER)')
F USROPN
/COPY QCPYLESRC,SYCDXFUSO
/COPY QPROTO,SYSTEMCMD
/COPY PROFOUNDUI/QRPGLEINC,PUISYNCR
/COPY QCPYLESRC,SYCDXD
/COPY QCPYLESRC,LDAUDS400
/COPY QCPYLESRC,PGMDS
/COPY QCPYLESRC,SYCDXI
/FREE
//monitor;
// system('ADDLIBLE LIB(ICSUI) POSITION(*LAST)');
//on-error;
//endmon;
//monitor;
// system('ADDLIBLE LIB(ICS) POSITION(*LAST)');
//on-error;
//endmon;
//monitor;
// system('ADDLIBLE LIB(PROFOUNDUI) POSITION(*LAST)');
//on-error;
//endmon;
SyncJob(*ON);
open unvbrf;
open sycdx;
*IN95 = *ON;
Read HEADER;
Write HEADER;
if required <> 'Y';
BrName = *blanks;
BrCde = *blanks;
Write DETAIL;
endif;
if aster = 'Y';
BrName = '*';
BrCde = '*';
Write DETAIL;
endif;
sxkey = *blanks;
sxcomp = mycomp;
sxnem = 'BR ';
setll sxkeyc sycdx;
reade sxkeyc sycdx;
DoW Not %EOF();
BrName = scbrcd + '-' + %trim(scbnam);
BrCde = scbrcd;
Write DETAIL;
Reade sxkeyc sycdx;
EndDo;
Write FOOTER;
*InLr = *On;
/END-FREE
Re: Universal PUIMAPP Question
Posted: Wed Nov 19, 2014 11:06 am
by Scott Klement
The parameter to SyncJob() is an indicator. You should have SyncJob(*ON) (or possibly SyncJob(*OFF)) but never SyncJob(*NO) Your code looks okay to me (just the text that seems to be wrong -- at first I thought this was a typo, but now you've said it many times.)
Not sure why this isn't working... I'll probably have to set up a test and debug it.
Re: Universal PUIMAPP Question
Posted: Wed Nov 19, 2014 11:51 am
by emhill
It was a typo. Just thinking and keying cross-eyed, I guess.
You are correct. The code is SYNCJOB(*ON) but it is not populating my dropdown unless I add the libraries. I will do some diagnostics on the browser and try to see what is being returned.
Thanks!
Re: Universal PUIMAPP Question
Posted: Wed Nov 19, 2014 5:11 pm
by Scott Klement
Eric,
It turns out, you don't need to call SyncJob(). The Universal Display session controller should automatically be calling SyncJob() for you! Hmmm... something must not be working.
I put together a test program of my own that loads the current library into a set of dropdown options (using the Universal handler) so that I could put together a test file and it would show me my library list. (I know, this is illogical, you'd never want to select a library from your library list in a drop-down -- but it was a convenient way to test the problem you reported.)
Anyway, it worked fine for me. If I change my library list in the Rich Display, it automatically gets updated in the Universal program that's called by the 'choices url', so I don't know why it's not working for you.
Can you take a look at your job log for the 'choices url' program and see if maybe there are any errors that would shed some light on the problem?
Re: Universal PUIMAPP Question
Posted: Wed Nov 19, 2014 5:34 pm
by Scott Klement
Here's one thing you can check for... for SyncJob() to work properly, you need to have an AUTH=XXXXXXXX in the URL for the 'choices url'. Profound UI will add this automatically -- but, will only add it if you don't already have an AUTH= in the URL yourself. So, please check to make sure you haven't set a variable named AUTH= in your 'choices url' property... if you are setting this, it would mess up the ability to sync to another job.
Looking at the request in a JavaScript debugger should show that Profound UI is adding this AUTH= string automatically if you don't put it there yourself.
Re: Universal PUIMAPP Question
Posted: Wed Nov 19, 2014 6:31 pm
by emhill
I'm not adding the AUTH= to my URL. I do see where PUI automatically adds it when I am using the developer's tools to try to do a little debugging so that looks ok.
If I completely remove the SYNCJOB(*ON) from my program and add no libraries in the program at all, I get this error:
========================================================================
Cannot resolve to object UNIVERSAL. Type and Subtype X'0203' Authority
X'0000'.
Function check. MCH3401 unmonitored by QRNXUTIL at statement 0000000033,
instruction X'0000'.
Message MCH3401 received for RPG procedure TESTBR (C G D F).
========================================================================
Which is the HANDLER in the workstn F spec I'm pretty certain.
The library list for that job is only showing one library I need which is ICS. I also need ICSUI and PROFOUNDUI:
==================================================================
ASP
Library Type Device Text
QSYS SYS System Library
QSYS2 SYS System Library for CPI's
QHLPSYS SYS
QUSRSYS SYS System Library for Users
TESTICS CUR ICSDIST - test files and programs
ICS USR ICSDIST Programs @Copyright 1999
QGPL USR General Purpose Library
QTEMP USR
PUISAMPLES USR
===================================================================
My library list in the Universal Designer shows all the libraries I need.
I can run this directly in the address bar from an empty tab and all works well:
================================================
http://server:8080/profoundui/universal ... =N&aster=Y
================================================
Displays the JSON exactly as it should.
It works great from the "choices url" when using the ADDLIBLE command in the RPG to get the correct libraries in the library list.
I know I'm just missing something simple somewhere.....
Re: Universal PUIMAPP Question
Posted: Thu Nov 20, 2014 10:18 am
by Scott Klement
Can you please look at the job log for the job running the Universal handler?
Re: Universal PUIMAPP Question
Posted: Thu Nov 20, 2014 10:52 am
by emhill
Scott,
The error and library list in the previous message are from the Universal Display job that creates JSON for the dropdown. The job that is displaying the dropdown has the correct libraries in the library list:
TESTICSUI SYS
ICSUI SYS
PROFOUNDUI SYS
QSYS SYS
QSYS2 SYS
QHLPSYS SYS
QUSRSYS SYS
TESTICS CUR
ICS USR
QGPL USR
QTEMP USR
PUISAMPLES USR
Re: Universal PUIMAPP Question
Posted: Thu Nov 20, 2014 3:03 pm
by Scott Klement
Yes, I understand that if the PROFOUNDUI library isn't in the library list, you'll get an error when you try to access the handler. Were there no other messages in the job log prior to that?