ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CGIDEV2 to present JPGs stored on the IFS?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: CGIDEV2 to present JPGs stored on the IFS?

    Viking

    As far as I can remember CGIDEV2 (like powerEXT Core) copy its source files to the job?s CCSID. If the job?s CCSID are 65535 this copy will fail since you can?t have a source file with CCSID 65535 so during the installation you may have to change the job?s CCSID to 37.

    Source files CCSID is important because all constants in the source code will have the hex/binary representation of that particular CCSID.

    If you are not able to get CGIDEV2 installed properly I would suggest that you install powerEXT Core instead. I can mail you a SAVF that are prepared and compiled to CCSID 37 so you just have to dump the SAVF into the library.

    powerEXT Core has a full featured CGIDEV2 service program so you are able to run Ralph?s examples just as easely. If you also want to include the powerEXT Core procedures it only requires minor changes to the CGIDEV2 program.

    Code:
    /copy qsrc,pxapihdr      General H-Spec's                             
                                                                           
     * powerEXT Service Program Connector                                  
    /copy qsrc,pxapicgicn    Basic HTTP connecter & Productivity Services 
                                                                           
     * Support for CGIDEV2 native subprocedures                            
    /copy qrpglesrc,prototypeb                                            
    /copy qrpglesrc,usec                                                  
    /copy qrpglesrc,variables3                                            
                                                                           
     /free                                                                 
      // Clear powerEXT Service Program & Responce Object                  
      clearSrvPgm(); 
      setContent(?*none?);
     
      // mimic?s prolog3 ?. /copy qrpglesrc,prolog3 if there is HTTP input                                                
      getExtInput();
    
      ... mix any CGIDEV2 or powerEXT procedures in the following code
    There are in the example source also examples how to run HTTPAPI with powerEXT Core procedures so all in all you get a broader platform.

    You can see the program stack here:

    Comment


    • #17
      Re: CGIDEV2 to present JPGs stored on the IFS?

      Henrik,

      if you do a DSPJOB option 2 page 3 what is the job's CCSID?
      If I do a DSPJOB of my interactive job, this is what I have:

      Code:
      Language identifier . . . . . . . . . . . . . . . :   ENU  
      Country or region identifier  . . . . . . . . . . :   US   
      Coded character set identifier  . . . . . . . . . :   65535
      Default coded character set identifier  . . . . . :   37   
      Character identifier control  . . . . . . . . . . :   *DEVD
      My QRPGLESRC source file in my library, and several other source files on the system have CCSID 37, but I actually do see a QRPGLESRC in our production library that has CCSID 65535. Hmmm... Anyway, I'm sure you're right that I would want the CGIDEV2 source file to have 37. Your powerExt looks interesting, I'm reading about it now.
      Last edited by Viking; April 16, 2014, 11:05 AM.

      Comment


      • #18
        Re: CGIDEV2 to present JPGs stored on the IFS?

        Originally posted by Viking View Post
        One thing I think I will need to figure out how to get around is that we have QCCSID set to 65535 on this system, and I've been told that it has to stay that way due to other software that requires it...
        I would prefer the opposite. Have the system set appropriately with a useful QCCSID, and then have only the jobs for the "other software" customized for whatever reason they need 65535.

        I'd be very interested in learning a reason to keep the entire system set at 65535.

        I'd think that developers on the system should need to be fully informed of the reasons, since they could need to code for it in essentially all jobs in order to ensure information integrity. That would be especially true when any servers are involved.

        But I'm not a serious expert in this, so I'm willing to learn when valid reasons exist.
        Tom

        There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

        Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

        Comment


        • #19
          Re: CGIDEV2 to present JPGs stored on the IFS?

          I would prefer the opposite. Have the system set appropriately with a useful QCCSID, and then have only the jobs for the "other software" customized for whatever reason they need 65535.
          Tom, I completely agree!

          Comment


          • #20
            Re: CGIDEV2 to present JPGs stored on the IFS?

            Viking, I looked up job default ccsid. Here's the link: http://publib.boulder.ibm.com/infoce...faultccsid.htm

            Notice it is 37. 65535 is a specialty situation. Whoever thinks the system needs to be set at that I don't think really know what all is involved. The system is at the whims of where OS code knows that 65535 is inappropriate and uses the default ccsid based on language. All it really accomplishes is being a pain to have to override the inappropriate 65535 (no conversion, from what?) for most situations to a useful ccsid and without it sort of half back in to being useful by the system using 37 anyway when it knows better.

            Comment


            • #21
              Re: CGIDEV2 to present JPGs stored on the IFS?

              Hi Viking

              Here this morning I created a LPAR and sat the QCCSID to 65535.

              The jobs then had ?.
              Coded character set identifier . . . . . . . . . : 65535
              Default coded character set identifier . . . . . : 277

              Since the language identifier (QLANGID) is DAN (Danish) the default CCSID becomes CCSID 277 on the job since the QCCSID is 65535.

              I installed powerEXT Core from my distribution on the LPAR and as expected the installation procedure copied the source files from CCSID 37 (the distribution) to CCSID 277 (the local environment).

              So as long as your job shows the CCSID?s you have posted you shouldn?t have any problems.

              Comment


              • #22
                Re: CGIDEV2 to present JPGs stored on the IFS?

                Wow Henrik, takk skal du ha!

                That's an interesting test and good to see that result. It seems to support what you and also Ralph were suspecting.

                I learned something from you guys on this but will keep reading some more in order to get a better understanding.

                Comment


                • #23
                  Re: CGIDEV2 to present JPGs stored on the IFS?

                  Just stumbled into this thread. How's the project going?

                  Did something kinda/sorta like you are asking with our database and spreadsheets. One master spreadsheet showed all DB2 files with links to open spreadsheets containing file layout info. All created on the fly.

                  Did this years ago with images.

                  Click image for larger version

Name:	ecko_image.PNG
Views:	1
Size:	72.5 KB
ID:	126768

                  As Scott mentioned you can do this all with CGIDEV2 and HTML/CSS/Javascript. I've found using frameworks like ExtJS (or the many others) for a front-end is very helpful for development and later maintenance of browser-based applications. I would hate to go back to some of my HTML applications and change the look and feel since tearing apart the HTML code.

                  With Javascript you could build a tree system to navigate through your images.
                  Last edited by mjhaston; June 17, 2014, 07:16 AM.
                  Your friends list is empty!

                  Comment


                  • #24
                    Re: CGIDEV2 to present JPGs stored on the IFS?

                    Hi,

                    I installed CNX Valence here and used it to create an awesome interactive browser application that does everything I needed and more. A grid that is fully searchable, we can rearrange the columns and sort on each of them, there are thumbnail images and other useful info on the grid and then the bigger image and product detail in a window. The product class can be selected from a drop-down list in the header above the grid. If there is no thumbnail and/or main image, then we can click to upload an image and it will be uploaded and saved on the IFS along with all the other images that we have already. We can click on a button to get the product details down to Excel. My users are impressed. It's very dynamic and cool and just took about a week. I've since made several other smaller applications too that are great. SQLRPGLE on the backend and Sencha Architect to create the extJS front-end.

                    You guys were right that I didn't have a CCSID problem as it does indeed seem to use the job CCSID.

                    I will still be getting into CGIDEV2 for some things where I need an HTML template and will populate it, so that's next. I'm looking forward to learning it. Thanks for all your help and input so far.

                    Comment

                    Working...
                    X