I'm so close, I can feel it!

I have created a CL program that redirects STDOUT to a PF (for the record, 
length doesn't matter), then copies to the IFS which is now *TYPE2. It sets the 
current directory, library, and some environment vars, and calls Net.Data. It 
then puts back the directory and library and deletes the override.

That program works fine--from the command line.

When I try to call that CL program from within Net.Data in production, it seems 
to work occasionally, but usually fails with: Duplicate HTML(xxx) section 
encountered... It is most certainly NOT duplicated. I can't nail down why it 
works once in a while.

Apparently the error is written to STDERR, because it ends up written in the 
browser, refers to the HTML block that only exists in the macro being used by 
the "generator", not in the Net.Data macro that started this flow. Again, it 
works from the command line.


I have two libraries:

Production library DISTV2: Contains INI, DB2WWW, and an ILE CL called CALLND 
that does nothing more than CALL DISTV2/DB2WWW (read somewhere that this would 
be necessary, but the details were not clear).

Generator library DISTCGV2: Contains INI, and same CL to call DISTV2/DB2WWW. It 
does not contain it's own copy of DB2WWW, although I have tried that variation.

Apache sends all "live" requests to production library DISTV2, and that is 
working fine for everything else. It then issues Net.Data %EXEC to call 
CACHEGENCL.

CACHEGENCL:

...
ADDENVVAR  ENVVAR('PATH_INFO') +                              
             VALUE('CACHEGEN.MAC/CACHEGENINDEX') +            
             REPLACE(*YES)                                    
ADDENVVAR  ENVVAR('K') VALUE(&K) REPLACE(*YES)                
ADDENVVAR  ENVVAR('SearchTyp') VALUE(&SEARCHTYP) REPLACE(*YES)
ADDENVVAR  ENVVAR('SearchVal') VALUE(&SEARCHVAL) REPLACE(*YES)
                                                              
CHGCURDIR  DIR('/QSYS.LIB/DISTCGV2.LIB')                      
CHGCURLIB  CURLIB(DISTCGV2)                                   
OVRDBF     FILE(STDOUT) TOFILE(DISTV2/CACHE) MBR(&CMBR)       
                                                              
CALL       PGM(DISTCGV2/CALLND)                               
                                                              
CHGCURDIR  DIR('/QSYS.LIB/DISTV2.LIB')                        
CHGCURLIB  CURLIB(DISTV2)                                     
DLTOVR     FILE(STDOUT)                                       
...

Am I missing something in setting up the call to Net.Data...or maybe in putting 
things back where they were?


> -----Original Message-----
> From: Metz, Zak 
> Sent: Friday, January 03, 2003 4:40 PM
> To: web400@midrange.com
> Subject: RE: [WEB400] Caching Net.Data
> 
> 
> Without buying GetURI, which appears to be a fine solution 
> but is over my non-existent budget...
> 
> I understand that I will be overriding STDOUT. Am I 
> overriding to a PF? What length? Any way to go straight to the IFS?
> 
> Then again, could Net.Data serve a static page from the IFS 
> or from the regular file system faster? I have no problem 
> with leaving the pages in PF members.
> 
> > -----Original Message-----
> > From: Raul A Jager [mailto:raul@abc.com.py]
> > Sent: Thursday, January 02, 2003 3:02 PM
> > To: web400@midrange.com
> > Subject: Re: [WEB400] Caching Net.Data
> >
> >
> > GETURI can read a page generated by Net.Data and store it for you.
> >
> > Metz, Zak wrote:
> >
> > >Almost there, one quick question: Can I pipe STDOUT directly
> > to the IFS when I call Net.Data from my CL program that is
> > generated the page into the cache, or is it a two-stepper, PF->IFS?
> > >
> > >
> > >
> > >>-----Original Message-----
> > >>From: Metz, Zak
> > >>Sent: Tuesday, December 10, 2002 10:51 AM
> > >>To: web400@midrange.com
> > >>Subject: RE: [WEB400] Caching Net.Data
> > >>
> > >>
> > >>Mr. Gombkötö, thank you very much for that reference. Indeed,
> > >>that was EXACTLY what I was looking for. I suspected it could
> > >>be done, but was at a loss on what to search on. STDOUT 
> was the key.
> > >>
> > >>I'm going to begin developing this, and I'm going to try to
> > >>build it in such a way that any website could use it.
> > >>
> > >>In fact, the site as it stands, at least the "backstage"
> > >>area, is already built in such a way that nearly any database
> > >>table could be worked with (add/edit/delete). Somewhere in
> > >>the back of my mind I have a fantasy about completing that
> > >>stuff, cleaning it up good, and sharing it with all my
> > >>friends here who love Net.Data.
> > >>
> > >>The problem is that, since this is my hobby site, every time
> > >>I get an idea of how I could be a little more clever, I dive
> > >>into it...it's the project that never ends!
> > >>
> > >>-----Original Message-----
> > >>From: Anton Gombkötö [mailto:gombkoetoe@assoft.com]
> > >>
> > >>
> > >>
> > >>>1. How would one go about "generating" the cached pages. I
> > >>>
> > >>>
> > >>know I could
> > >>
> > >>
> > >>>use a PC-based tool to "download" the site, then publish it
> > >>>
> > >>>
> > >>back to the
> > >>
> > >>
> > >>>IFS, but I'd rather 100% automate this. Can I call
> > Net.Data from the
> > >>>command line and redirect its output to a file?
> > >>>
> > >>>
> > >>Yes!
> > >>Just look at the Net.Data forum:
> > >>http://server6.kepnet.com/cgi-bin/db2www/forum.d2w/view?SID=20
> > >>000110182221678137
> > >>
> > >>
> > >>
> > >>>2. I realize this may be too application-specific, but in
> > >>>
> > >>>
> > >>vagaries, how
> > >>
> > >>
> > >>>could you "wrap" the website to be able to recognize that a
> > >>>
> > >>>
> > >>page is in the
> > >>
> > >>
> > >>>cache and display it? Maybe convert the single parm that can
> > >>>
> > >>>
> > >>be passed
> > >>
> > >>
> > >>>into the page (K) in a folder name, something like
> > >>>
> > >>>
> > >>Index/1/Index.HTML,
> > >>
> > >>
> > >>>Index/2/Index.HTML...I don't know...
> > >>>3. If I do something like the naming above, can the logic to
> > >>>
> > >>>
> > >>decide if the
> > >>
> > >>
> > >>>cached page exists or not be moved to the Apache server
> > >>>
> > >>>
> > >>itself using some
> > >>
> > >>
> > >>>sort of pattern match mapping?
> > >>>
> > >>>
> > >>2 and 3: i once saw a very interesting article discussing
> > >>this. It was an
> > >>Apache article, but i can't remember where it was.
> > >>
> > >>The main "trick" was to have a custom "page not found"-page
> > >>that produces
> > >>the page as desired. Maybe that helps or helps someone to
> > >>remember or point
> > >>you to the story.
> > >>_______________________________________________
> > >>This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
> > >>To post a message email: WEB400@midrange.com
> > >>To subscribe, unsubscribe, or change list options,
> > >>visit: http://lists.midrange.com/cgi-bin/listinfo/web400
> > >>or email: WEB400-request@midrange.com
> > >>Before posting, please take a moment to review the archives
> > >>at http://archive.midrange.com/web400.
> > >>
> > >>
> > >>
> > >>
> > >
> > >_______________________________________________
> > >This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
> > >To post a message email: WEB400@midrange.com
> > >To subscribe, unsubscribe, or change list options,
> > >visit: http://lists.midrange.com/cgi-bin/listinfo/web400
> > >or email: WEB400-request@midrange.com
> > >Before posting, please take a moment to review the archives
> > >at http://archive.midrange.com/web400.
> > >
> > >
> >
> > _______________________________________________
> > This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
> > To post a message email: WEB400@midrange.com
> > To subscribe, unsubscribe, or change list options,
> > visit: http://lists.midrange.com/cgi-bin/listinfo/web400
> > or email: WEB400-request@midrange.com
> > Before posting, please take a moment to review the archives
> > at http://archive.midrange.com/web400.
> >
> >
> 
> _______________________________________________
> This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
> To post a message email: WEB400@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/web400
> or email: WEB400-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/web400.
> 
> 


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.