× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Martin,

While there are more recent products for web development on i5, here is a bog standard request for IBM's Net.data product which has always been shipped ready to go as QHTTPSVR/DB2WWW.
I created a very basic demo that displays a report from which you can add, update or delete an ice cream from a file containing just a flavour and image.
Step 1 is to update your Apache config.
Step 2 is to enter the source code below into the IFS file /home/demo/macros/icecream
Then navigate to http://(yourdomain)/test/cgi/icecream/report

1. To run this demo your Apache httpd.conf file needs these directives
<Location /test>
Order Allow,Deny
Allow From all
</Location>
<Directory /home/demo>
Order Allow,Deny
Allow From all
</Directory>
ScriptAliasMatch ^/test/cgi/(.*) /QSYS.LIB/QHTTPSVR.LIB/DB2WWW.PGM/home/demo/macros/$1
MapMatch ^/test/(.*) /home/demo/Html/$1

2. All the source code below goes into one file named /home/demo/macros/icecream
%function(dtw_sql) dspList() {
select * from qgpl.icecreams
%report { <table>
%row { <tr>
<td><a href="$(V_IMAGE)">$(V_FLAVOUR)</a></td>
<td><a href="edit?flavour=$(V_FLAVOUR)">Edit</a></td>
</tr>
%} </table>
%}
%}

%function(dtw_sql) dspItem() {
select * from qgpl.icecreams where flavour='$(flavour)'
%report { %if (flavour != "") @dtw_assign(USE,"READONLY") %endif
%row { @dtw_assign(image,V_IMAGE) %}
<tr><td>Flavour : </td><td><input name="flavour" value="$(flavour)" $(USE) /></td></tr>
<tr><td>Image : </td><td><input name="image" value="$(image)" size="100" /></td></tr>
%}
%message { 100 : "" : continue %}
%}

%function(dtw_sql) updateItem() {
update qgpl.icecreams set image='$(image)' where flavour='$(flavour)' with NC
%}

%function(dtw_sql) deleteItem() {
delete from qgpl.icecreams where flavour='$(flavour)' with NC
%}
%function(dtw_sql) insertItem() {
insert into qgpl.icecreams values('$(flavour)', '$(image)') with NC
%}

%{*********************************************************************************** %}
%html(report) {
<h1>Ice Cream List</h1>
@dspList()
<p><a href="edit">Add New Flavour</a>
%}

%html(edit) {
<h1>Edit Ice Creams</h1>
<form method="POST" action="update">
<table>
@dspItem()
</table><p>
%if (flavour != "") <input type="submit" name="sbmbtn" value="Update"/>
&nbsp;&nbsp;&nbsp; <input type="submit" name="sbmbtn" value="Delete"/>
%else <input type="submit" name="sbmbtn" value="Add" /> %endif
&nbsp;&nbsp;&nbsp; <input type="submit" name="sbmbtn" value="Cancel" />

</form>
%}

%html(update) {
%if (sbmbtn == "Add") @insertItem()
%elif (sbmbtn == "Delete") @deleteItem()
%elif (sbmbtn == "Update") @updateItem() %endif
<p>$(sbmbtn) has completed for flavour $(flavour)
<p><a href="report">Return to List</a>
%}
%{*********************************************************************************** %}


---------------------------------------------------------


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin
Sent: Sunday, 9 December 2012 10:39 a.m.
To: Midrange Systems Technical Discussion
Subject: Ice cream

I am not sure if this request is in the right forum, or even if it is on-topic, but here goes.

I like to do demonstrations/examples of basic techniques on my website.
Anyone who has visited www.martinvt.com/ knows the stuff is pretty simple stuff. It has been in my mind for some time to do a demo of a simple Intranet application that does various things with a simple
physical file. After several false starts, confusion, and missteps, I
realize that this simple idea is still too complex for my current understanding.

My intention is to have a dual-sided application: do the tasks both
with 5250 green screen and with a browser application. Lets say I have
a physical file of flavors of ice cream with a link to an image of the item. I wish to add/update/delete to the file, and do a couple or reports from the file, including displaying the image in the browser.
All on an i.

I have lots of questions, but probably the first question should be: Is there already an example out there somewhere that I should look at? The second question is: Am I tilting at windmills? Is this a foolish idea with no useful purpose? Third, is this something that is of interest to average RPG programmers?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.