Difference between revisions of "JGuiGen Demo with Hale's notes"

From lightwiki
Jump to: navigation, search
Line 53: Line 53:
 
# mention the 10 or so actions which are already coded for me, and I dont have to write code for that correctly validate and make sure the users of my gui do not loose data in irritating ways
 
# mention the 10 or so actions which are already coded for me, and I dont have to write code for that correctly validate and make sure the users of my gui do not loose data in irritating ways
 
## changing rows in the table
 
## changing rows in the table
## next in the right click pop-up
+
## right click and ... wow look at all these things you'll get ... do you want to write the code yourself to do all this?
## previous in the right click pop-up
+
## Anyway, if we try to right click and ...
## "Refresh table" in the right click pop-up
+
### go to the "next" row in the table
## Find in the richt click pop-up and in the top menu
+
### go to the "previous" row in the table
## Extra in the right click pop-up and the top menu
+
### "Dup" this row - which means duplicate the current row with a new id number
## "Dup" in the right click which means duplicate the current row with a new id number
+
### "Refresh table" in the right click pop-up (not working ... oops)
## "Add" in the right click and in the main menu
+
### "Add" a new row
## the exit button in the upper left
+
### "Find" another row
## and the window close X button in the upper right ... web developers eat your heart out
+
### "Extra" or any of a number of other things, like
## we may have missed 1 or 2 ... isn't that rediculous
+
## "Add" another row from the main menu
## The idea is that you user has started to make a few changes to a row in your table, but then they answered the phone, got up went to the bathroom, got a cup of coffee, came back and now they are trying to get onto the next task ... maybe adding a new entry ... but hey JGuiGen reminds them that they started making a change, to give them a chance to save their changes.
+
## "Find" another row from the main menu
# Notice that the font chooser has octothorpes around the text, two points I'd like to make about this:
+
## Or "Extra" another row from the main menu
## This entire gui is Internationalized ... every bit of text you see here is coming from a resource bundle ... the pund signs are telling us as a developer of this gui that there is no entry in the resource bundle for this text, but even though the entry is missing
+
## Or the "Exit" button in the upper left
## the code still runs, which, for anyone whose ever had to do serious i18n in Java, you will appreciate
+
## or even this nasty X button over here
## we could also go in now with JGuiGen and regenerate the resource bundles for the internationalization of that menu option ... we'll get to tht a bit later
+
## It's going to perform a check to see if we've changed something ... web developers eat your heart out
# Notice that "ExtRa" button ...
+
## Again, this checking is something we want in our gui ... it's just not something we want to actually have to sit down and write the code to do for our gui ... JGuiGen does that for us.
 +
# Notice that "<b>ExtRa</b>" button ...
 
## This is just a simple button in the code that
 
## This is just a simple button in the code that
 
## you will be able to easily find the code for it in the java
 
## you will be able to easily find the code for it in the java
Line 74: Line 75:
 
## add your own functionalty to it
 
## add your own functionalty to it
 
## and look it has built in functionality underneath that you might like to use ... option 1, 2, 3
 
## and look it has built in functionality underneath that you might like to use ... option 1, 2, 3
 +
# Notice that the "<b>font chooser</b>" has octothorpes around the text, two points I'd like to make about this:
 +
## This entire gui is Internationalized ... every bit of text you see here is coming from a resource bundle ... these pound signs are telling us as a developer of this gui that there is no entry in the resource bundle for this text, but even though the entry is missing
 +
## the code still runs, which, for anyone whose ever had to do serious i18n in Java, you will appreciate
 +
## we could also go in now with JGuiGen and regenerate the resource bundles for the internationalization of that menu option ... we'll get to tht a bit later
 
# Find
 
# Find
 
## First name "is equal to" Hale
 
## First name "is equal to" Hale

Revision as of 02:58, 13 April 2006

Back to Main Page

The objective:

  • A Screencast ... dry run using rev 82 ... recorded 2006/04/12

The demo script

  1. Assumed to have installed: subversion, java sdk, maybe eclipse 3.1.2
  1. Here we are in a virtual network computing session ... going hardcore ...
  2. svn checkout https://svn.sourceforge.net/svnroot/jguigen/JGuiGen/trunk/ jguigen
    1. Checking out of the latest JGuiGen source code
    2. In case this is your first time hearing about JGuiGen ... it is all about J for Java, Gui for Graphical User Interfaces, and the Generation thereof, hence "J" ... "Gui" ... "Gen"
    3. Some have said that they'd rather write code that writes code than just write code.
    4. So again what we are checking out here is code that compiles in order to generate code that compiles in order to render GUIs that allow users to do something I call ... View, add, edit, and delete from a table.
    5. The big picture here is that we will be able to quickly generate a screen that allows users to view, add, edit, and delete entries from a table.
    6. Another person called this "Elegant CRUD" which sounds like an oxymoron where CRUD stands for Create, review, update, and delete ... or as I translate it ... add, view, edit, delete
    7. Only the most motivated, high speed, open source development allowed ... no holding back
    8. grabbing the latest source using subversion on sourceforge.net
    9. The jars, a 3 MB sample database, help files, and of course the source ... there it is
    10. we have revision ...
    11. Let's get down to business in JGuiGen
  3. cd jguigen
  4. ls -l - looks like a normal project folder
  5. here's some images ... here's a lib for supporting libraries ...
  6. all code here is under the Gnu General Public License ... the GPL
  7. unzip JGuiGenMisc.zip - these are starter files that we usually don't want other folks committing back into the source, such as configuration files that you'll need to customize for yourself when you are generating your own Graphical User Interfaces here ... and other files that you will need to ...
  8. time ./build.sh
    1. So again, to be clear, right now we are building our graphical user interface generator, called JGuiGen ... starting with no compiled code ... only source
    2. Looks like it built fine, so we will need a classpath ... something like this ...
  9. classpath=".:"`echo lib/*.jar | tr " " ":"`
  10. which basically says that we need the vm to look here in this directory, and in the jars in our lib directory, and trans-combobulate spaces into colons for a classpath that looks like this
  11. echo $classpath
  12. Ok so lets start JGuiGen ...
  13. java -cp $classpath JGuiGen
    1. first we will need to tell it who we are ... let's tell it we are Hale ... one of the folks in the sample config file
    2. blow past i18n
    3. Look it found our browser ... and ...
    4. Look it found our word processor
  14. Users
  15. UserDemo
    1. Let launch right into a full blown gui ... with all the bells and whistles, to give you an idea of what you will be able to generate when you generate your own guis using JGuiGen
    2. Now this is a big screen with, lots, and lots of features ... let's look at a few of them
  16. change the social security number
  17. change the start date
  18. change to a different row in the table and show off the validation catch
  19. sort by clicking on a column
  20. right click and drop your jaw
  21. click back in the main window and change the ssn
  22. right click ... choose next
  23. watch validation work again
  24. mention the 10 or so actions which are already coded for me, and I dont have to write code for that correctly validate and make sure the users of my gui do not loose data in irritating ways
    1. changing rows in the table
    2. right click and ... wow look at all these things you'll get ... do you want to write the code yourself to do all this?
    3. Anyway, if we try to right click and ...
      1. go to the "next" row in the table
      2. go to the "previous" row in the table
      3. "Dup" this row - which means duplicate the current row with a new id number
      4. "Refresh table" in the right click pop-up (not working ... oops)
      5. "Add" a new row
      6. "Find" another row
      7. "Extra" or any of a number of other things, like
    4. "Add" another row from the main menu
    5. "Find" another row from the main menu
    6. Or "Extra" another row from the main menu
    7. Or the "Exit" button in the upper left
    8. or even this nasty X button over here
    9. It's going to perform a check to see if we've changed something ... web developers eat your heart out
    10. Again, this checking is something we want in our gui ... it's just not something we want to actually have to sit down and write the code to do for our gui ... JGuiGen does that for us.
  25. Notice that "ExtRa" button ...
    1. This is just a simple button in the code that
    2. you will be able to easily find the code for it in the java
    3. rename it to "my custom report"
    4. add your own functionalty to it
    5. and look it has built in functionality underneath that you might like to use ... option 1, 2, 3
  26. Notice that the "font chooser" has octothorpes around the text, two points I'd like to make about this:
    1. This entire gui is Internationalized ... every bit of text you see here is coming from a resource bundle ... these pound signs are telling us as a developer of this gui that there is no entry in the resource bundle for this text, but even though the entry is missing
    2. the code still runs, which, for anyone whose ever had to do serious i18n in Java, you will appreciate
    3. we could also go in now with JGuiGen and regenerate the resource bundles for the internationalization of that menu option ... we'll get to tht a bit later
  27. Find
    1. First name "is equal to" Hale
    2. OR
    3. last name "is like" Sing%
    4. Execute
    5. Find ... note it saved our most recent find critereon
    6. note the "Show inactive" button which toggles and ... guess what allows the user to find rows that they or someone else deleted last week, but were not really deleted of course ... just flagged that way so that you did not have to write that code again ... just use JGuiGen
  28. place holder for dicussing
    1. Reports
    2. Look and feel
      1. right click again ... choose inverse mono look and feel
      2. right click ... choose Native
    3. Print the screen
  29. click Help in upper right ... This is your place to put your own help for your gui
  30. Exit out of User Demo
  31. The help that is "here" one of the many examples of JGuiGen eating it's own dog food.
    1. Simply tonnes of documentation about JGuiGen e.g.
    2. here is a manual and for those of you who like to RTFM
    3. here is a read me which shows you, for example, all of the databases suppoerted by JGuiGen
    4. You can cuddle up with this in bed some evening
  32. Now let us move on now and generate our own gui
  33. Exit JGuiGen
  34. vi JGuiGenIni.xml, add table name "Lead", add class name "Lead", add table model name "LeadTm"
  35. sh ./runUtil.sh DatabaseManager
    1. type: "... Standalone"
    2. driver: JGuiGenDb
    3. Ok
  36. cut and paste new table "Lead"
  37. cut and paste the index
  38. discuss the table columns
    1. lead_ID integer identity
    2. lead_DATE timestamp
    3. lead_PHONE char(20)
    4. isremoved smallint - the deleted flag
    5. lastchangedby char(20) - for sanity and multi user functionality
    6. lastchangeddate timestamp default null - for validation and multi user functionality
  39. java -cp $classpath JGuiGen
  40. Starting in the Data Dictionary Menu
    1. Mark Tables - place a check mark on the "Process Table" field for your new Lead Table
    2. Check Data Dictionary, Leave Flags, Run Now
    3. Edit Data Dict ... Select the Lead table, Do a bunch of stuff for each column
    4. Generate Application (Model, Order, Create Java)
    5. Exit from the Internationalization causes a write
    6. Generate HTML (optional)
  41. Compile and run the new gui
    1. show out-of-the-box features of the gui
    2. View, Add, Edit, Delete ... right click duplicate
    3. Search for some rows
    4. Oh ... what's this? ... Reports!
    5. try closing a window after a change
    6. try changing the row to edit after a change
  42. wash, rinse, repeat ?, ?, ?, and ? showing features
    1. Quickly adding a column, such as: ssn, phone, address
    2. Internationalization
    3. Hot keys
    4. Change validation error message and Test
    5. blast the coffee cup
    6. run test scripts against the gui
    7. show test script output
  43. launch eclipse



Notes about getting JGuiGen installed on SourceForge: I ran into two "issues" while moving a new project to SourceForge as a Subversion version control project. 1. SourceForce wants a Subversion dump file to start with which menat I needed to place JGuiGen into subversion locally. I created a repository using the Tortisesvn client. I imported the files into the repository and checked them out again. Then it was time to create the dump. TortiseSvn doesn't create dump files so I needed to use the command line. No problem. The instructions said use the svnadmin tool to create the dump file. The issue came with figuring out what folder to be in when I ran svnadmin. I finally found out that being in the main repository folder worked. That seems like a strange place to work from but it worked.

2. The instructions on uploading a new project said to use scp and copy the file to scp FILENAME.ZIP USERNAME@shell.sourceforge.net:/home/groups/P/PR/PROJECTNAME/FILENAME.ZIP

I tried this and it didn't work scp jguigen.zip Halepringle@shell.sourceforge.net:/home/groups/P/PR/jguigen.zip.

What they don't mention in these instructions is that the "P/PR" are the first letter and first two letters of our project name. This worked scp jguigen.zip Halepringle@shell.sourceforge.net:/home/groups/J/JG/jguigen.zip.

3. To update the SourceForge web site I used Winscp and logged into shell.sourceforge.net using my sourceforge username and password. That placed me in /home/users/h/ha/halepringle. I navigated to /home/groups/j/jg/jguigen/htdocs and uploaded the web pages. Hale 4/10/2006