OpenBiz Tutorial
description
Transcript of OpenBiz Tutorial
![Page 1: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/1.jpg)
OpenBiz Tutorial
Open Business software frameworkSep. 2003Note: this tutorial is for openbiz 1.1.x and lower version. Please use it as a reference document for openbiz 2.0
![Page 2: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/2.jpg)
OpenBiz IntroductionWhat is OpenBiz? OpenBiz is an open php business
software framework
How can OpenBiz help? Build data-oriented complicated web
application in an easy way Build your application by constructing
metadata file, not by coding Easily extending for special
requirements
![Page 3: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/3.jpg)
Build your applicationData model design Database schema
BizObj design – business logic unit What properties in the BizObj What functions provided by the BizObj
BizForm design – presentation unit Map BizObj properties and functions on UI
BizView design – presentation container Contain multiple BizForm Define relationship between BizForm
HTML Template design – GUI
![Page 4: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/4.jpg)
Data model designEntity Relationship Graph Modeling business data into database table
schema Please refer to database design book for details
Create tables in database Create tables/indexes using GUI tools or scripts Specify “Prefix” in id_table for each table so
that SYSID of new record will be auto-generated as “Prefix”+sequence format. i.e. PLY_101
Add your database connection information to config.xml. i.e. replace the “Default” database
![Page 5: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/5.jpg)
Data model design (example)
regist {SYSID, PLAYER_ID, EVENT_ID, FEE}
player {SYSID, NAME, EMAIL, PHONE…}
event {SYSID, NAME, HOST, LOCATION… }
A registration system modeling
![Page 6: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/6.jpg)
BizObj design
Each BizObj is based on a database table – base tableProperties in the BizObj Map a field from a base table column Map a field from a foreign table column Does a field need pick data from other BizObj?
Functions provided by the BizObj Basic functions are provided by OpenBiz Implement special functions by extending
BizObj
![Page 7: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/7.jpg)
BizObj design (example)BORegist - base table = registProperties Id regist.SYSID Player Id regist.PLAYER_ID Player Name player.NAME (foreign table) Event Id regist.EVENT_ID Event Name event.NAME (foreign table) Fee regist.FEE
Functions – BizObj provides enough functions, no special requirement
![Page 8: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/8.jpg)
BizObj design (example cont.)
Add BORegist BizObj in OpenBiz Objects Browser
![Page 9: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/9.jpg)
BizObj design (example cont.)
Fill Attribute valueXML metadata file for BORegist BizObj
Use Edit Attributes frame:1. Click Table icon to select a table2. Click Column icon to select a table column3. Click BizObj icon to select a BizObj4. Click BizField icon to select a BizField
![Page 10: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/10.jpg)
BizForm designBizForm is the UI proxy of BizObj – base BizObj A BizForm can have difference presentation mode
(default, edit, query) associated with templates
Map a field control from BizObj field Map a field control from base BizObj field Does a field need pick data from other BizForm? Is the field editable, visible?
Add functions on BizForm Map functions provided by BizForm class to
buttons. Implement special functions by extending BizForm
![Page 11: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/11.jpg)
BizForm design (example)FMRegist - base BizObj = BORegist
Default mode uses list Template Edit, query mode uses group Template
Map BizObj fields to UI Registration Id [Id] Player Id [Player Id] Noneditable Player Name [Player Name] Noneditable, Need select
field data from Player BizForm Event Id [Event Id] Noneditable Event Name [Event Name] Noneditable, Need select
field data from EventPopup (a popup view contains FMEvent BizForm)
Fee [Fee] Need select field from 2 values $15, $20.
![Page 12: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/12.jpg)
BizForm design (example cont.)
Add function buttons on UI toolbar Search button SearchRecord() Go button RunSearch() New button NewRecord() Edit button EditRecord() Copy button CopyRecord() Delete button DeleteRecord() Save button SaveRecord() Cancel button CancelRecord()
Add Navigation button on UI Navbar Go Previous Button MovePrev() Go Next Button MoveNext()
![Page 13: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/13.jpg)
BizForm design (example cont.)
Add FMRegist BizForm in OpenBiz Objects Browser
![Page 14: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/14.jpg)
BizForm design (example cont.)
Fill Attribute value
XML metadata file for FMRegist BizForm
Use Edit Attributes frame:1. Click BizField icon to select a BizField of the Bizobj defined in root element2. Click BizForm icon to select a BizForm
![Page 15: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/15.jpg)
BizView designBizView is the container of BizForms and other HTML controls Page layout is defined in templates
Define the relationship between BizForms A BizForm can help subforms that depend
on its current data A BizForm can depend on the current data
of other BizForm
![Page 16: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/16.jpg)
BizView design (example)What can a user do on the view? Add/edit a new player Add/edit registered event for a player
What should a user see on the view? A player BizForm A registration BizForm
What the relationship between Forms The registration form depends on the
current data of the player form
![Page 17: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/17.jpg)
BizView design (example cont.)
List of players (FMPlayer BizForm)SubCtrls="FMRegist"
List of registered events of the player(FMRegist BizForm)
Dependency="reg_plyid=FMPlayer.ply_id"
Dependency
UI name of FMRegist “Player Id”
UI name of FMPlayer “Player Id”
![Page 18: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/18.jpg)
BizView design (example cont.)
Create a BOPlayer BizObj Id players.SYSID Name players.NAME Email players.EMAIL Phone players.PHONE
Create a FMPlayer BizForm Player Id [Id] Player Name [Name] Sortable Player Email [Email] Player Phone [Phone] Add function buttons and templates as
FMRegist
![Page 19: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/19.jpg)
BizView design (example cont.)
Redesign FMRegist Because FMRegist depends on
FMPlayer, the player shown on FMPlayer is same as the player shown on FMRegist. It’s reasonable to hide Player Name in FMRegist
Hide Player Name in FMRegist Player Name [Player Name]
Noneditable, Hidden
![Page 20: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/20.jpg)
BizView design (example cont.)
Add RegistView BizView in OpenBiz Objects Browser
![Page 21: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/21.jpg)
BizView design (example cont.)
Fill Attribute value
XML metadata file for RegistView BizView
Use Edit Attributes frame:1. Click BizForm icon to select a BizForm2. Click Text icon to input long text
![Page 22: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/22.jpg)
HTML Template designTypical templates Table template – a HTML table contains
multiple BizForm records Group template – a HTML group contains
single BizForm record
Other templates Tree template (todo) Special templates
All templates must has format <form id={$name} name={$name}>…</form>
![Page 23: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/23.jpg)
HTML Template design (cont.)
Data output from BizForm.Render {$title}, {$name} as value {$toolbar}, {$navbar} as array {$columns} as array – field labels/headers In table format
{$cells} as 2D array – fields values of multi-records {$selRow} as array – current selected row flags
In array format {$controls} as array – fields values of a record
These output variables can be used in your template files Please refer to http://smarty.php.net/ for details
![Page 24: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/24.jpg)
HTML Template design (cont.)
Design UI theme of your application Build color theme using CSS Build button theme
GUI templates included in OpenBiz Gray Ocean (todo) Land (todo) Rose (todo)
![Page 25: OpenBiz Tutorial](https://reader034.fdocuments.net/reader034/viewer/2022051401/56814575550346895db2448a/html5/thumbnails/25.jpg)
Summary
Development steps with OpenBizRequirements
Data model Create BizObj
Create BizFormUser Interface
Create BizView
Create Templates