Page 1 of 3

Universal PUIMAPP Question

Posted: Thu Nov 06, 2014 10:15 am
by negley
Hello,

I am attempting to create some JSON in Universal. I created a very simple sample project to try out tool. However, when i call my program via the http://server:8080/profoundui/universal/jsontest, it does not load any json to the screen. The page acts as if it is still loading. The program just writes and ends, no loops or logic.

My universal display file has a json object without variable data.

Thanks for the help!

-Bill

Re: Universal PUIMAPP Question

Posted: Thu Nov 06, 2014 10:19 am
by Scott Klement
Hi Bill,

Can you please check the job log of the job to see if there are any errors? You can use WRKACTJOB JOB(PROFOUNDUI) (replace 'PROFOUNDUI' with the name of your HTTP server instance. PROFOUNDUI is our default name, but it's something that you can change when you install the product.)

My guess is that it's not loading because it's having trouble finding the display file in the library list, getting an authority error, or some other similar issue. The job log should hopefully tell us what's happening.

Thanks

Re: Universal PUIMAPP Question

Posted: Thu Nov 06, 2014 10:22 am
by negley
Well i feel silly now. Thanks!

Re: Universal PUIMAPP Question

Posted: Fri Nov 07, 2014 1:53 am
by Scott Klement
Did you figure out the problem?

Re: Universal PUIMAPP Question

Posted: Thu Nov 13, 2014 11:52 am
by negley
Yes i did, thanks! I was able to create some json to use with the ajaxJson function. Works like a charm!

If only i could do SOAP out of Universal, that would be great!

Re: Universal PUIMAPP Question

Posted: Mon Nov 17, 2014 2:59 am
by Scott Klement
You can do SOAP with the Universal Display files if you wish. SOAP is just XML that follows a particular standard -- if you use the Universal designer to input XML in SOAP format, it'll output SOAP, as expected.

Using a tool designed for SOAP would be easier, of course, since these generally do all of the XML work for you (so you don't have to code it yourself.) But if you don't mind coding the XML, the Universal display files would work fine.

Re: Universal PUIMAPP Question

Posted: Mon Nov 17, 2014 11:17 am
by negley
True, i guess what i meant was to be able to send and receive SOAP.

Re: Universal PUIMAPP Question

Posted: Tue Nov 18, 2014 6:02 pm
by emhill
Another question along those lines in this thread:

I have created a Universal Display and RPG to populate a select box using the "choices url" property of the select box. I have had to add libraries within my RPG so that it will pick up the "UNIVERSAL" handler and the files I am using in the RPG. I know in RPGsp we would use the SYNCJOB(*NO) to set the library list to to match PUI. Is there anything we can use that mimics that here? Am I missing a setting somewhere?

Thanks!!!!!

Re: Universal PUIMAPP Question

Posted: Tue Nov 18, 2014 6:30 pm
by Scott Klement
You can use SyncJob(*ON) in a Universal Display as well, if needed. Just remember to make the files USROPN and open them after the SyncJob() call.

Re: Universal PUIMAPP Question

Posted: Tue Nov 18, 2014 6:55 pm
by emhill
Getting a binding error on create:
===================================================================================
Message . . . . : *SRVPGM object QZDMMDTA in library QSOC not found.
Cause . . . . . : *SRVPGM object QZDMMDTA in library QSOC was specified in
binding directory QUSAPIBD in library *LIBL, but was not found for binding.
Recovery . . . : Contact your application provider or service
representative.
CPD5D02 Diagnostic 30 11/18/14 16:48:09.406744 QBNBIND QSYS *STMT QBNBIND QSYS *STMT
From module . . . . . . . . : QBNBSYMR
From procedure . . . . . . : QBNBSYMR__UnresolvedReferenceIterator
Statement . . . . . . . . . : 31
To module . . . . . . . . . : QBNBSYMR
To procedure . . . . . . . : QBNBSYMR__SignalUnresolvedReferences
Statement . . . . . . . . . : 8
5770SS1 V7R1M0 100423 Job Log S104DB7A 11/18/14 16:48:09 Page 2
Job name . . . . . . . . . . : TESTBR User . . . . . . : ERIC Number . . . . . . . . . . . : 009647
Job description . . . . . . : ERIC Library . . . . . : QGPL
MSGID TYPE SEV DATE TIME FROM PGM LIBRARY INST TO PGM LIBRARY INST
Message . . . . : Definition not found for symbol 'SYNCJOB'.
Cause . . . . . : No definition was found for reference SYNCJOB in *MODULE
object TESTBR in library QTEMP. The definition either does not exist or is
not of the same data or procedure type as the reference. Recovery . . . :
Try the Create Program (CRTPGM) command again, supplying an object that
contains a definition for symbol SYNCJOB.
===============================================================================

Code: Select all

H DFTACTGRP(*NO) ACTGRP(*NEW)

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
What am I doing wrong?

Thanks!!!!!