Download presentation
Presentation is loading. Please wait.
Published byJean Parsons Modified over 9 years ago
1
® IBM Software Group © 2006 IBM Corporation The EGL Workbench (Eclipse) This section introduces you to the Eclipse IDE (integrated development environment). Eclipse is the EGL workbench and project organizer. Learning how to use it, navigate, and develop within it is a key to success, with EGL.
2
2 Last update: 12/04/2007 UNIT EGL and the Workbench – terms and concepts A Workbench Walk-Through Creating an EGL “HelloWorld” Application Topics: RBD Workbench
3
3 Last update: 12/04/2007 What is the RBD Workbench? The RBD Workbench is the software that enables you to create, test, modify, run and deploy your EGL applications It organizes and maintains your software development resources It provides access to tools like editors, design tools, compilers and folders for managing your application’s contents Organizer Tools Edit and design facility NOTE NOTE – Several of the screen captures taken of the Workbench used WebSphere Application Server. If you are using Tomcat, the Project Explorer will look different. We will explain all relevant differences at the appropriate time during the course.
4
4 Last update: 12/04/2007 How do I develop with the RBD Workbench? You will work with a variety of resources: EGL code, Web pages, Graphic images, Data files. The Workbench allows most of the resources associated with a project to be stored in a workspace – which is the highest-level folder that contains everything you can access during a development session. Your Workbench session begins with the opening of a Workspace. Everything you have access to is inside this Workspace. Workspace resources are organized into - Project(s) - Folders - Files Project Folders Files Workspace
5
5 Last update: 12/04/2007 What is in a Project? Workspace projects Workspace projects organize and manage related application resources. They can be designed along lines of: Batch – or – Online applications Different business applications (Accounts Payable, Inventory, Claims, Part Assembly, etc.) Common (shared) projects consisting of data and record definitions that can be reused configuration data generation options Projects also contain configuration data, such as build files** and generation options for EGL Java and/or COBOL generation folders Projects may be further divided into folders EGL “Web” projects contain the following high-level folders: \EGLSource\ \Java Resources: src\ \WebContent\ NOTES - See slide NOTES and the Help topic: Contents of an EGL Application EGL Source Files Web Pages and Web App Resource Folders Java Source Files
6
6 Last update: 12/04/2007 What is in \EGLSource\ \EGLSource\ \EGLSource\ is the default folder that is the highest level folder under which all of your EGL resources are organized. These EGL resources include EGL: Packages Files Programs Libraries Services JSFHandlers EGL build-files … Typically you will create sub-folders under \EGLSource\ to manage your EGL resources We will define what is in all these EGL resources a bit later in this course.egl For now, it is enough to know that all EGL files end with the extension:.egl - See the Help topic: EGL Projects, Packages and Files
7
7 Last update: 12/04/2007 What is in Java Resources: src \src\ \src\ is the default highest level folder that contains all of the generated Java, for each and every successfully compiled (or in EGL terms, “generated”) EGL resource \src\ You will rarely if ever need to actually open or even view the contents of \src\ But the folder structure of \src\ will match \EGLSource\ one-for-one.java Your generated java files will end with a.java extension
8
8 Last update: 12/04/2007 What is in \WebContent\ \WebContent\ \WebContent\ is the default highest-level folder under which all of your web resources will be organized, including: Application Server reserved folders: META-INF WEB-INF Web Pages (*. jsp ) and web page resources: \theme\ - Graphics (*.gif, *.jpg) \theme\ - Template pages (*.htpl) \theme\ - Cascading Style Sheets (*.css) Note that your installed EGLWeb project might have a few additional folders and files – such as an \images\ directory, that we’ve supplied, containing graphics files you’ll use throughout the course And if you’re not familiar with the above types of web files don’t worry. We’ll be covering them later on in the course Content
9
9 Last update: 12/04/2007 WAS Terms and Concepts –.EAR File – Simplified J2EE Deployment – for WAS Users EAR An EAR (Enterprise ARchive) file contains a J2EE application, which is a collection of J2EE modules. The modules contain Java generated from EGL. Because individual J2EE modules are contained within the EAR, they can easily be managed and deployed as a whole to WebSphere. An EAR also has a Deployment Descriptor file which describes how it should be deployed to WebSphere. In addition, each module within the EAR has its own Deployment Descriptor. An EAR file is similar to an iSeries “savefile for i” – or to a System z “load library” – which are files deployed on mainframes that also contain individual “modules” EGLWebEAR other.WAR files DeploymentDescriptor Utility Java Classes.JAR files EGLWeb.WAR file (Modules)
10
10 Last update: 12/04/2007 Where (under what folder and/or sub-folder) in your project would you look for the following files? allcustomers.jsp _______________ allcustomers.java _______________ allcustomers.egl _______________ ibm.gif _______________ stylesheet.css _______________ True/False – all EGL source files (each and every one) will: a. End with an extension of.egl b. Be organized and exist under the \EGLSource\ folder – or a sub-folder in your project Note – if you do not know what these file types are do not worry, we will be covering them and their use a bit later in the course. Paper/Pencil Review Questions
11
11 Last update: 12/04/2007 Workbench Views Workbench tools with visual content are portrayed in “views” Views are windows which show relevant information about whatever you are currently looking at or working on. Development tasks usually require many different views. Programming: Code editing, navigators, testing environment, debugging,… Page design: Page layout graphic editing, specifying page control properties site navigation/design Page Data View Content Area View Palette View Console View Project Explorer View NOTE NOTE – Several of the screen captures taken of the Workbench used WebSphere Application Server. If you are using Tomcat, the Project Explorer will look different. We will explain all relevant differences at the appropriate time during the course.
12
12 Last update: 12/04/2007 Important Views Out of the dozens of Workbench views available to assist you with your development, there are an essential nine: 1.Project Explorer 2.Content Area 3.Page Data 4.Palette 5.Properties 6.Console 7.Servers 8.Problems 9.Outline
13
13 Last update: 12/04/2007 Project Explorer – or Project Explorer View Organizes your project…and…allows you to: Create new resources: EGL programs, services, etc. Web pages and other files Open files into the Content Area Manipulate files: Delete, Move and Rename Run pages Debug EGL programs Generate (compile) Refactor When “A” is changed change related “B” resources Set project-level properties By Right-clicking over a resource in the Project Explorer you access a “Context Menu” that provides options By double-clicking over a resource in the Project Explorer you open that resource in the Content Area view Right-click Context Menu
14
14 Last update: 12/04/2007 Content Area Content Area Double-clicking a file in Project Explorer opens it in the Content Area The appropriate editor for that file-type will also open Here’s Page Designer Page Designer is an RBD editor that is used for laying out and creating your pages from JSF (graphical) components. Here’s the EGL editor. You might not be able to tell in black & white but the source is “colorized”: Keywords in maroon/bold Identifiers (variables/function names) in black Literals (within in “double-quotes”) in blue Comments in green (not shown)
15
15 Last update: 12/04/2007 JSF Handler Page Data View JSF Handler (EGL) Page Data is one of the views you get if you click on a.JSP file. It is a view of the JSF Handler (EGL) resources that you can drag and drop onto your web page Data Data – which become labels and input/output controls Actions Actions – which become Submit Buttons Services Services – which become entire forms, based on their parameters and functions Services EGL Function EGL Variables Drag ‘n Drop from Page Data onto your Web Page
16
16 Last update: 12/04/2007 Palette View drag & drop Provides a drag & drop way to add controls to your U.I. (Web page or Rich Client or Text User Interface form) Drag & Drop functionality of Page Designer If the Palette View is not available by default, open it from the menu: Window Show View Other… General (expand) Palette
17
17 Last update: 12/04/2007 Properties View Allows you to specify the behavior and characteristics of a U.I. control declaratively (without having to code at the source API level). One of the primary development constructs is that you: 1.Drag and drop a resource 2.Customize its properties Properties (View) of the Postalcode Input Text Field’s JSF attributes
18
18 Last update: 12/04/2007 Servers View – WebSphere Application Server Allows you to start and stop the application server in which you run and debug your application. And to publish (re-deploy) your application. Context Menu for the Servers view
19
19 Last update: 12/04/2007 Console View Allows you to see a trace of the run-time events and messages to “system out” that happen as your application executes on the server. Application Server Messages Running Web Page
20
20 Last update: 12/04/2007 Problems View Allows you to see syntax or structural problems in your application. Note, by double-clicking on a problem the file in question is opened in the Content Area, and your mouse is positioned to the line (and even characters) in question. Hyper-linked Problem Description in the Problems view Source file containing the problem
21
21 Last update: 12/04/2007 Outline View Provides a consolidated, click-able list of your programs: Imports Functions Variables Other EGL resources Especially useful for: Navigating throughout large source files Large, complex web pages Top-Down code analysis Learning – or getting the giste of some code quickly
22
22 Last update: 12/04/2007 Working With Views maximize You can maximize a view by double-clicking in the middle of the View Tab (and re-size the view back, by doing the same) Close You can Close a view (inadvertently or on purpose) – by clicking the X Re-open a view Show View > You can Re-open a view by pulling down the Window menu, and selecting: Show View >
23
23 Last update: 12/04/2007 Workbench Perspectives Perspectives organize views and other tools into groupings designed for particular roles, oriented to specific tasks There are only a few perspectives you will use: Web Perspective Used for creating and testing Web applications EGL Perspective Used for creating and testing batch and Text User Interface applications Debug Perspective Used to debug applications Data Perspective Used to view relational data and run SQL interactively Workbench in the Web Perspective *** *** Different Perspectives offer different Views of your development resources *** That is, the views available will change, and even change position in the IDE depending on your current Perspective.
24
24 Last update: 12/04/2007 Working With Perspectives There are only a few things you will do with Perspectives (besides use them) Open Open Perspective From your current workbench perspective, open a new perspective with its default views and tools Reset Reset Perspective Return to the RBD installation defaults, for a perspective Close Close Perspective Close a perspective if no longer needed for your work at the moment Customizesave Customize and save a perspective When you have used the Workbench a lot, you may want to create your own custom perspectives, with customized views and tools, etc. All in-use perspectives can be switched back and forth from an icon at the top-right corner of your Workbench which shows the perspectives
25
25 Last update: 12/04/2007 Workspace Preferences – Customizing the Workbench The Preferences dialog (under the Windows menu) allows you to customize your workspace development environment. From the main Preferences dialog you should check: EGL with BIRT report support EGL support with JSF Component Interfaces Other preferences you can customize: Editor You can change the editor’s appearance Page Designer Specify whether to delete associated files SQL Database Connections Specify a connection to an external database (DB2, IDS, etc.) for SQLRetrieve Click Apply
26
26 Last update: 12/04/2007 Workspace Preferences – Customizing the Workbench – Modify SQL Preferences The SQL Preferences allow you to customize how the RBD tooling generates SQL resources SQL From the SQL Preferences dialog check: Change to lower case and capitalize first letter after underscore Remove underscores Click Apply Click Apply
27
27 Last update: 12/04/2007 Workspace Preferences Lab – EGL Editor Editor Preferences You can change the editor’s appearance, and how it treats and displays your source statements UN -check: UN -check: Annotate errors as you type Optionally – feel free to try out other editor preferences Click Apply Click Apply
28
28 Last update: 12/04/2007 OPTIONAL OPTIONAL Workspace Preferences Lab – EGL Editor Templates Statement templates allow you to customize the default Intelli-sense (accessed via Ctrl/Spacebar - Content Assist) development. From EGL Template preferences you can: Add new statement/ templates Edit existing templates Remove un-wanted templates Export all of your templates for sharing with a group Import a set of templates Optional Workshop Using the slide and Preference, create a new template as shown here (you can copy/paste the pattern code from the Notes section of this slide). To use the new template, from inside an EGL source file (within a function) Type if Press Ctrl/Spacebar
29
29 Last update: 12/04/2007 OPTIONAL OPTIONAL Workspace Preferences Lab – EGL Editor Templates/Modify Defaults Besides adding new statements, you may want to modify the existing Editor Templates: Change the defaults Add new Properties Optional Workshop handler egl-jsf PageDesigner Page Code generation Select the handler egl-jsf PageDesigner Page Code generation template Click Edit… Add the EGL handler property shown Click OK To save your edits Click OK To save your Template preferences cancelOnPageTransition=yes,
30
30 Last update: 12/04/2007 Really Optional Really Optional Workspace Preferences Lab – EGL Editor Optional/Challenge Workshop. You can add a new editor to work with your EGL source files by doing the following: File Associations 1.From Preferences > General > Editors, click File Associations 2.From the File types: list, select *.egl 3.From Associated editors: 1.Click Add… 2.From External Programs – select from the list …or… 3.Browse to your own custom editor and select it (example shown is WordPad) 4.Click OK 5.Click OK To use the new editor, from Project Explorer, Right-Click Select Open With
31
31 Last update: 12/04/2007 Help There is a robust help system with documentation and examples available in many categories: Keyword search Category search Web Resources Points you to the EGL forum and home page on DeveloperWorks Tutorials Gallery Contains additional in-the- box education samples Samples Gallery Contains working, sample applications Cheat Sheets Contains step-by-step “how-to” instructions
32
32 Last update: 12/04/2007 PC Graphical/Mouse-Driven Development Skills You will do two things with Workbench: 1. Type EGL statements (business logic) using the EGL Editor, and sometimes type other short properties in Workbench dialogs and fields. This is no different from programming in any other toolset or language 2. Navigate through the Workbench, and do “drag & drop” development (with your mouse). If you’re new to drag & drop development here’s a quick lesson. Left-mouse button Select something - Click a field - Click a drawer in the Palette - Select a file in the Content Area Scroll up and down/Right and left Double-click a resource in Project Explorer to open it in the Content Area Open an RBD menu (at the top) By selecting (Left-mouse) and holding, you drag and drop a resource: - Drag an EGL variable onto a page - Drag JSF Component onto a page Right-mouse button Open a “context menu” - From a Page in the Content Area - Edit Page Code – bring up the EGL for the page - Run a page - Project Explorer – the context menu allows you to - Create a new resource - Delete/move - Generate (compile) a resource - Run a page on the Server
33
33 Last update: 12/04/2007 Review 1. Content Area___ The highest level folder that contains all of project folders you can work with. You choose this right after launching RBD 2. Page Data___ Where you customize a web page Control’s appearance and behavior 3. Project Explorer___ The area in which you edit files and use Page Designer to layout and create web pages. 4. Perspective___ A perspective that displays and organizes views that are optimal for doing web application development with EGL 5. Servers View___ A View that allows you to select and open files, delete them, create new files, generate (“compile”) and run web pages 6. Console View___ The View that shows your JSF Handler’s declared variables, functions and services (available for direct drag & drop operations on a page) 7. Preferences___ The View that contains drawers of visual components to work with in Page Designer (like HTML, EGL and JSF Components) 8. Problems View___ An organized collection of Views 9. Properties View___ The area of the Workbench where you customize the workspace’s behavior, setup 10. Palette___ The View that allows you to stop and start your Application Server 11. Web Perspective___ The view that contains all of the syntactical errors in your EGL source, and configuration errors for your project 12. Workspace___ The view that shows application server run-time messages Match the Following Terms and RBD Vocabulary
34
34 Last update: 12/04/2007 Review Answer the following questions: 1. Under what menu option, can you access windows to change perspectives and open Views, modify your Workspace preferences? mathlib sqrt 2. From the product help, search on: mathlib sqrt Check out both the mathlib and the function 3. Questions on the Palette View - What are the two options in the EGL drawer in the Palette? - Under what Palette drawer can you find a Horizontal Rule? - Under what Palette drawer can you find a Command – Button? 4. From the Properties view, what is the Id: property associated with this field? 5. From what View (and how) do you open a file (i.e. how do you load a file into) the Content Area for editing or browsing? 6. List the steps to Run a.JSP page, on the server? 7. What View exposes (shows) EGL variables and functions from a JSFHandler, and allows you to drag them onto the Content Area to create JSF controls and fields? is 8. By the way, what is an EGL JSFHandler? (Search the help on: JSFHandler Part – and select, Elements of a Web Application)
35
35 Last update: 12/04/2007 Lab Assignment – Workbench “Test Drive” – 1 of 2 Do the following: 1.Launch RBD 1.Launch RBD and select your workspace (the one you set up and configured in Chapter 0) 2.Find 2.Find (by opening folders in Project Explorer and opening files in the Content Area) the following resources (files): allcustomers.java – the Java generated by RBD for the allcustomers page allcustomers.egl – the EGL JSF Handler for the allcustomers web page allcustomers.jsp – the allcustomers web page stylesheet.css – the default cascading style sheet for this project – See Notes EGLWeb.eglbld – the default “build file” for this project – See Notes Content Area Make the files in the Content Area full-screen, then size them back down Content Area Close all of the files in the Content Area ConsoleFind and close the Console view then re-open the Console view Project ExplorerFrom Project Explorer – explore your project (Open and close several of the folders under: EGLSource and WebContent)
36
36 Last update: 12/04/2007 Lab Assignment – Workbench “Test Drive” – 2 of 2 Do a bit more test driving: 5.From the Palette view – find (locate) the following (Note – you’ll need open a.JSP page in the Content Area, in order to see the Palette view) Enhanced Faces Components:Enhanced Faces Components: Command Button, Input text, Image, HTMLAn HTML: Horizontal Rule, Table, Image EGLAn EGL variable Window Debug 6.From the Window menu, open the Debug Perspective Using the icons (top right hand corner of Workbench) switch from the Debug to the Web Perspective Close the Debug perspective 7.Reset your “current” (should be Web) Perspective 8.From the Servers view, start your application server Project Explorer Run allcustomers.jsp 9.From Project Explorer, Run allcustomers.jsp on the server Help 10.From Help : 1.Search on the EGL topic: DataItem 2.From Tutorials Gallery/Tours run the Enterprise Generation Language tour 3.Find and open the EGL Cheat Sheets category. View one or more (time permitting) Lab
37
37 Last update: 12/04/2007 UNIT EGL and the Workbench terms and concepts A Workbench Walk-Through Creating an EGL “HelloWorld” Application Topics: RBD Workbench
38
38 Last update: 12/04/2007 The Pages (you will create) Following the detailed steps in this lab, you will build these two simple Web pages with EGL and the RBD tools.
39
39 Last update: 12/04/2007 The Workflow Process – From 10,000 Feet The steps you will follow to create these pages consist of: 1.Launch RBD and select your Workspace 2.Create a new web page from a pre-built template 3.Customize the page’s default layout 4.Edit the EGL code that enables the business logic for the page 5.Drag & drop EGL variables on the page to create new JSF Components 6.Run (test) the page on the server Now begin the lab from the detailed instructions starting on the next slide…
40
40 Last update: 12/04/2007 Lab – Launch RBD and select your Workspace (If RBD is not already up and running) From the Windows start menu launch RBD From the initial prompt, specify or browse to and select your Workspace Your EGLWeb project should open
41
41 Last update: 12/04/2007 Create a new Web Page Using a Page Template Right click From Project Explorer Right click over \WebContent\ and select: New Web Page hello1.jsp Name the page: hello1.jsp Sample Templates From: Sample Templates Family A (no navigation) Family A (no navigation) A_gray.htpl Select A_gray.htpl Finish Click Finish
42
42 Last update: 12/04/2007 In the Content Area: Modify the default page header text and add a few line breaks (using the Enter key) After you’ve completed the above, Right-click over the Web Page, Edit Page Code …and select Edit Page Code Customize the hello1.jsp Web Page
43
43 Last update: 12/04/2007 When you create a new.JSP page with RBD, it automatically creates a JSFHandler for the page to allow you to call services and code your business logic. code the following: Using the EGL Editor, code the following: string field1 A string variable named field1 literal” field1 A statement that assigns a “literal” to field1 A new EGL function that forwards the field1 value to a new page (you will create the hello2.jsp page in the next step of this lab) Press: Ctrl+Shift+F Press: Ctrl+Shift+F ( simultaneously ) This will format your source as shown in the screen capture To save your EGL statements, either: Save file Click the Save file icon in the top left section of the menu Ctrl+S Click your mouse inside the JSFHandler code, and press: Ctrl+S Add EGL Statements to the JSFHandler Don’t Don’t change this (even if it doesn’t match) Note the semi-colons ; that end your new EGL statements;
44
44 Last update: 12/04/2007 hello1.jsp Return to Page Designer for: hello1.jsp hello1.jsp (hint: Click the hello1.jsp tab in the Content Area) (From the Page Data view) Expand the Data folder Select: field1 - string Left-click and hold (the mouse button down) Drag and Drop it …onto the page next to a line break Add an EGL Field to the hello1.jsp Page – 1 of 3 Note: When you drag and drop Page Data variables onto hello1.jsp, the RBD tooling automatically generates all of the Java/J2EE APIs needed to render Server-Side EGL data in the browser as HTML labels and values in the browser.
45
45 Last update: 12/04/2007 (From Insert Control) create input/output fields by specifying : Updating an existing record Options… un Click the Options… button, (From Options) un-check the Delete button OK Click OK Finish …then click Finish Add an EGL Field to the hello1.jsp Page – 2 of 3
46
46 Last update: 12/04/2007 (From Page Data) Expand the Actions folder on top of Select (Left-click, hold) and drag and drop the fwd() function on top of the Submit Button Bind an EGL Function to the Submit Button on the.JSP Page – 3 of 3
47
47 Last update: 12/04/2007 1. Right-clickRun on Server… 1. Right-click over the page and select Run on Server… 2. Save 2. Save any un-saved resources 3. If you are using Tomcat Update context root Finish 3a. Make sure that: Update context root… is checked – and…Click: Finish Run the.JSP Page Note – if your page does not display, please go to the next slide to diagnose
48
48 Last update: 12/04/2007 If your page does not display and you are not using Tomcat, or if you get other Exception errors when trying to run: hello1.jsp, please: Double-check to ensure there are no syntax errors in hello1.egl ( no X’s ) If there are syntax errors, correct them and try again (mouse-over the X’s to see what’s wrong) If there are no syntax errors, and you’re using WebSphere, and your page doesn’t display, please ask your instructor for assistance If you are using Tomcat, as your Application Server, And if, after trying to Run on server – you get an error like the following Restart the Tomcat server: Servers (From the Servers tab) Click the Restart the server icon hello1.jsp Then try running the: hello1.jsp page on the server again. What if I Get a Server Error When I Run My Page?
49
49 Last update: 12/04/2007 Lab – Part 2 – Create hello2.jsp Page and the hello2.egl Code From the EGL editor, add the following : stringfield2 A string variable named: field2 string Add a parameter to: onConstruction ( field1 string ) Add this assignment statement Add this new Function Ctrl+Shift+F - Press Ctrl+Shift+F to format your code Ctrl/S - Save your work (press Ctrl/S – or click the Save icon) \WebContent\ hello2.jsp (From Project Explorer) Right-click over \WebContent\ and create a new web page – named: hello2.jsp Select the same template for the new page (A_gray) (Working with hello2.jsp in the Content Area) Customize the page’s default text Edit Page Code Right-click over the page and select: Edit Page Code
50
50 Last update: 12/04/2007 Add an EGL Field and Function to the.JSP Page 1. (From Page Data) Select (left-click, hold), Drag & Drop the field2 - string variable on the page Configure the controls produced – and create an output (read-only) field : 2. (From Page Data) Expand the Actions folder Select (left-click, hold), Drag & Drop the returnToHello1() EGL function on the page. This will create a Submit Button which fires off a call to your EGL business logic inside the returnToHello1 function, when the user clicks it at run-time Page Data View A graphical window into the variables and functions inside the EGL JSF Handler for this.JSP page
51
51 Last update: 12/04/2007 Run hello1.jsp – Test Your Work run hello1.jsp (From Project Explorer) Right-click over, and select run hello1.jsp on the server Update context root Finish If you are using Tomcat make sure that: Update context root… is checked – and… Click: Finish (at Select Tasks) every time Note that you will do this every time you run a page using Tomcat
52
52 Last update: 12/04/2007 OPTIONAL ( OPTIONAL ) Lab3 Create an EGL Batch Program (From Project Explorer) Right-click over EGLSource, and select: New > Program From the New EGL Program part wizard, specify: Package: kbprograms EGL source file name: kbprogram Click Finish
53
53 Last update: 12/04/2007 Lab3 – continued – Code the Batch EGL Program The tooling will create a skeleton EGL batch program. Edit the program, and add the following statements: Four variable declarations Assignment statements Invoke a function Add a function that adds that calculates simple interest // Comments are optional (FYI) The slide ***Notes contain finished code for the above.
54
54 Last update: 12/04/2007 Lab3 – continued – Save and Debug the Batch Program 1. Save your edits by clicking the Save icon on the toolbar 2. Add a breakpoint to your EGL program, by double-clicking in the Editor’s gray left-hand border 3. (from Project Explorer) Right-click over kbprogram.egl Debug EGL Program Select: Debug EGL Program Yes Click Yes – at Confirm Perspective Switch *** See Notes *** See Notes, if you’re using the Vista O.S.
55
55 Last update: 12/04/2007 Lab3 – continued – Modify the Values and Step (F5) Through the Code Double-click the values in the Variables View to over-ride your assignment statements (note – click right on top of the variable Values) F5 Press F5 to step through your EGL statements – one line at a time. Note that as the values change the Variables view updates. When you are finished, from the top right corner Close the Debug Perspective *** See Slide Notes
56
56 Last update: 12/04/2007 Extend This Batch Program Workshop (More Optional Lab Work) Time permitting: Return to the Web Perspective: 1. Add the new EGL functions shown in this screen capture main() 2. From inside the main() function invoke the new functions 3. Save your edits – and clean up any EGL syntax errors - which will appear as a red 4. Debug (step through) your new code. Between function invocations, consider zeroing out (resetting) the result variable values for each computation: - principal - interest - nbrYears 5. Close the Debug Perspective, and return to the Web Perspective *** See Slide Notes for the finished code
57
57 Last update: 12/04/2007 Optional Lab4 – Working With EGL Code Formatter – 1 of 2 Ctrl+Shift+F You have already seen that Ctrl+Shift+F will format your code, when you are editing inside a file. But there are several other things you should know about this tooling feature: 1.You can format code for: Files All of the EGL files in a Package Right-click Format Right-click over the file or package, and selecting Format This allows you to apply the source code formatting rules to more than one file, in one operation Feel free to try this on kbprogram.egl jsfhandlers All of the files in the jsfhandlers folder
58
58 Last update: 12/04/2007 Optional Lab4 – Working With EGL Code Formatter – 2 of 2 To see or change the Formatter Rules From: Preferences EGL EGL Editor Editor Formatter Formatter Click: Show… To view the current rules New… New… To define custom EGL code formatting rules Note that you could (when finished with new rules) Export them to your fellow project team members
59
59 Last update: 12/04/2007 Optional Optional Lab5 - Create an Online Calculator If time permits, create the following new, EGL web page Using this EGL JSFHandler logic And these controls – dragged from Page Data: Challenge Lab Challenge Lab - Create the rest of the basic functions (and web page buttons) for your calculator: Subtract/Multiply/Divide
60
60 Last update: 12/04/2007 Optional Optional Lab6 – Create a Typical Login Page Create the following new web page hello3.jsp Name: hello3.jsp Layout EGL Code Notes: Don’t worry about comments //I am an EGL comment Don’t worry about blank lines If you get syntax errors (Red X’s appear) Mouse-over them to read what’s wrong
61
61 Last update: 12/04/2007 Now that you have completed this unit, you should have: Navigated the eclipse IDE, Opened project folders and files Set project properties Defined and used the following eclipse views and perspectives: Views –Content Area –Project Explorer –Page Data –Palette –Console –Servers –Capabilities Perspectives –Web –Debug Unit Summary
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.