Real Java,
Real Easy. Real Java, Real Easy:
The Straight Path to e-business
for iSeries Developers
Jim Mason
jmason@[Link]
iSeries. mySeries.
Real Java, Agenda
Real Easy.
Objectives
The Parts to e-Business
The Technologies for e-Business
The Roadmap To Get There
iSeries. mySeries.
Real Java,
Real Easy. Our objective for this session…
9I know where Java fits in my e-business plan!
9I can develop e-business applications in Java!
iSeries. mySeries.
Real Java, Did you think that JAVA meant maximum
Real Easy.
effort for minimum results?
It does not have to be…
iSeries. mySeries.
Real Java,
Real Easy.
What have you been asking for?
9Simple
9Reliable
9Secure
9Portable
9Maintainable
9Affordable
9Investment Protection
iSeries. mySeries.
Real Java,
Real Easy.
How far can I go with my skills?
9Knowledge of business rules
9Programming skills
9Basic SQL skills
You’re really
almost home!
iSeries. mySeries.
Real Java,
Real Easy.
eBusiness Part I - Best Language…
9Secure, open, robust and viable platform
9Write once, run anywhere flexibility
9Fastest growing resource pool
iSeries. mySeries.
Real Java,
Real Easy.
eBusiness Part II- Best Approaches…
Simple Flow Chart Approach
Complex Object Approach
iSeries. mySeries.
Real Java, eBusiness Part III - Best Design…
Real Easy.
Presentation View
Application Flow Control
Business Rules Model
iSeries. mySeries.
Real Java,
Real Easy. First, what do you want to build?
¾Serve business information to a browser?
¾Call business functions from a Web application?
Next, the “MVC”
technologies that get you
there fast!
iSeries. mySeries.
View Technologies
View
Real Java,
Real Easy. Control
Model
HTML
-tag-based mark-up language
-rendering content to a browser
-including text, multimedia, and links.
JSP
-scripting language
-creating dynamic web pages
-based on Java.
Browser
iSeries. mySeries.
Real Java, HTML Syntax Examples
Real Easy.
Simple, static presentation language.
Tag Interpretation
<html> </html> Begin, end of html document
<title></title> Document title
<h1></h1> Header size 1
<h2></h2> Header size 2 (smaller than size 1)
<h3></h3> Header size 3 (smaller than size 2)
<h4></h4> Header size 4( smaller than size 3)
<p></p> Paragraph delimiter
<a href=""></a> Link identifier
<img> <img> Image identifier/loader
<table></table> Table formatting
iSeries. mySeries.
Real Java, JSP Syntax Example
Real Easy.
Simple, dynamic presentation language.
<%@ page language="java" %>
<%@ taglib uri="[Link] prefix="f" %>
<html>
<head>
<title>
List Events
</title>
<body>
<f:form name="frmEvents" method="POST">
<table width="216" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#eeffdd">
<td height="15" colspan="2" class="hdtext"><img src="images/[Link]" width="1" height="1">Events</td
</tr>
<f:repeater name="rptEvents">
<tr>
<td class="date"><f:text name="EventDateFMT" repeater="rptEvents" nocontrol="true"/><br/>
<a class="hdtxtGreen" href="/portal/page/[Link]?id=<f:text name="EventID" nocontrol="true"
repeater="rptEvents"/>"><span class="hdtxtGreen"><f:text repeater="rptEvents" name="Description"
nocontrol="true"/></span></a>
<br><br/>
</td>
</tr>
</f:repeater>
</table>
</f:form>
</body>
</html>
iSeries. mySeries.
Control Technology
View
Real Java,
Real Easy. /* Control
* Main entry point to the script.
*/
void main() throws FormResultsConversionException, StoreNotFoundException, ResultStoreException, NotFoundException,
ValueException, FormResultsNotFoundException, ClassNotFoundException, SQLException{ Model
FormPage frmIndex = new FormPage("/jsp/[Link]");
//root to SJ is the application context
//Main program loop will loop forever from request to request until the user ends their session.
while(1==1){
[Link](); //Display the index page and process any results.
//Make sure that we clear any error messages prior to validation.
[Link]();
// get button clicked and value of contact nbr entered
String ctcnum = [Link]("CTHSEQNUM");
String sButton = [Link]();
Java ctcnum = ctcnum + "";
Control
if([Link]()>0){
//Validate the contact number.
Status valstatus = validateSearch(ctcnum);
Script //Check our results.
if(![Link]()){
[Link](valstatus);
}else{
showEdit(ctcnum);
}
}else{
// didn't click search button so pass this to the generic button
//handler. If no shared buttons was clicked, control will
//drop back to the main screen.
handleSharedButtons(sButton);
} //end validation
ctcnum="";
} // end main while
}//end main
iSeries. mySeries.
Real Java, Control Technology Close Up
Real Easy.
// CRUD mainline StructuredJ script example void
main(String[] args) throws Exception {
p = getPropertiesFromFile();
if (CURRENT_ACTION==0) CURRENT_ACTION = SEARCH_ACTION;
while (notExit) {
switch (CURRENT_ACTION) {
case SEARCH_ACTION: searchTable(); break;
case BROWSE_ACTION: browseTable(); break;
case ADD_ACTION: addTable(); break;
case EDIT_ACTION: editTable(); break;
case DELETE_ACTION: deleteTable(); break;
default: processActions();
};
}; Look familiar?
}
iSeries. mySeries.
RPG concept StructuredJ Web concept
DDS display source file JSP source files
Real Java, DDS Record format for screen JSP file for form ( = screen)
Lays out input and output fields on Web
form
Real Easy. DDS source files compiled for use JSP files compiled for use
Enter RPG 5250 source program Enter SJ script
Compile RPG source to program object Compile SJ script to executable Java class
Declare DDS formats in program Declare JSP files in SJ script
1. FORDENTD2 CF E WORKSTN 2. FormPage frmIndex = new
SFILE(ORDSFL:SflRrn) FormPage("/jsp/[Link]")
Java Control Script
Do mainline until user hits Exit button Do mainline until user hits Exit button
3. DOU *IN03 = $Exit 4. while(1==1){
vs. Write / Read DDS Record format
5. EXFMT PROMPT
Write / Read JSP file
6. [Link]();
Execute a subroutine or procedure Execute a script method
RPG… 7. EXSR ClrError
Move data from form field to program
8. [Link]();
Move data from form field to program field
field
10. String ctcnum =
9. MOVE CTHSEQNUM CTNUM [Link]("CTHSEQNUM");
If test on field length If test on field length
11. CTLEN IFGT 0 12. if([Link]()>0){
Call edit subroutine for a contact nbr Call edit subroutine for a contact nbr
13. EXSR SHOWEDIT 14. showEdit(ctcnum);
If no contact entered, call Choices to run If no contact entered, call Choices to run
selected Function selected Function
15. EXSR CHOICES 16. handleSharedButtons(sButton);
Other logic is in subroutines or Other logic is in methods in the same script
iSeries. mySeries.
Model Technologies
View
Real Java,
Real Easy. Control
Model
The model layer is
existing business EJBs
logic and data. No
need to rebuild BEANS Java-Based
Model
them in Java. C Technology
RPG Options
O COBOL
N
View T
R
HTML/JSP O
L Databases
Java Control Business Rules and Data
Script
iSeries. mySeries.
Real Java, Putting It Together for YOU!
Real Easy.
HTML
View JSP
The path
to Java for
iSeries
developers… Control Procedural Java
Control Scripts
Model iSeries Data
iSeries Programs
iSeries. mySeries.
Real Java, Customized Roadmap to e-Business
Real Easy.
Fast Path to eBusiness
Java
Application Programming
- Java (OO)
Control Scripts
- Java Server Pages
- HTML
5 days -of training
1 month to implement
71 days of training/6-12 months to implement
iSeries. mySeries.
Real Java, The tools of the trade…
Real Easy.
BUILD RUN
iSeries / i5
Open Source
•Eclipse
•StructuredJ Native JVM*
•JTOpen
•Jetty AS
Java Control Program
Opening screen
RPG
OR Enter
Personal Info
Enter
Account Info
Create
Account
WDSC
yes
Another
account?
no
Summary
Page
DB
OR Jetty
(Open Source)
Application Server
OS/400
* Or Linux or Windows in an LPAR
iSeries. mySeries.
Real Java,
Real Easy.
It’s what have you been asking for…
9Simple
9Reliable
9Secure
9Portable
9Maintainable
9Affordable
9Investment Protection
iSeries. mySeries.
Real Java,
Real Easy. Did we meet our objectives?
9Do you know where Java fits in my e-business plan?
9Can you develop e-business applications in Java!
iSeries. mySeries.
Real Java,
Real Easy.
Next Steps…
9Choose a simple e-business application
9Take a custom training workshop
9Consider consulting services
iSeries. mySeries.
Real Java,
Real Easy. “Simplify Java Web development with StructuredJ”
By Jim Mason
July 1, 2004
For a free copy send an email to info@[Link]
Courtesy of Experts Journal
iSeries. mySeries.
Real Java,
Real Easy.
Contact StructuredSoft
Training & Consulting Services
email: info@[Link]
Download StructuredSoft Eclipse Platform Free
[Link]
Join StructuredJ Developer Community
[Link]
iSeries. mySeries.