Tutorial

download Tutorial

of 25

description

learn

Transcript of Tutorial

  • 5/21/2018 Tutorial

    1/25

    OpenBiz Tutorial

    Open Business software framework

    Sep. 2003

    Note: this tutorial is for openbiz 1.1.x and lower version. Please use it asa reference document for openbiz 2.0

  • 5/21/2018 Tutorial

    2/25

    OpenBiz Introduction

    What 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 constructingmetadata file, not by coding

    Easily extending for special requirements

  • 5/21/2018 Tutorial

    3/25

    Build your applicationData model design Database schema

    BizObj designbusiness logic unit

    What properties in the BizObj What functions provided by the BizObj

    BizForm designpresentation unit Map BizObj properties and functions on UI

    BizView designpresentation container Contain multiple BizForm

    Define relationship between BizForm

    HTML Template designGUI

  • 5/21/2018 Tutorial

    4/25

    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 thatSYSID of new record will be auto-generated as

    Prefix+sequence format. i.e. PLY_101

    Add your database connection information toconfig.xml. i.e. replace the Default database

  • 5/21/2018 Tutorial

    5/25

    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

  • 5/21/2018 Tutorial

    6/25

    BizObj design

    Each BizObj is based on a database tablebase table

    Properties 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

  • 5/21/2018 Tutorial

    7/25

    BizObj design (example)

    BORegist - base table = regist

    Properties 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.FEEFunctionsBizObj provides enoughfunctions, no special requirement

  • 5/21/2018 Tutorial

    8/25

    BizObj design (example cont.)

    Add BORegist BizObj in OpenBiz Objects Browser

  • 5/21/2018 Tutorial

    9/25

    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

  • 5/21/2018 Tutorial

    10/25

    BizForm design

    BizForm is the UI proxy of BizObjbase 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

  • 5/21/2018 Tutorial

    11/25

    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 fielddata from Player BizForm

    Event Id [Event Id] Noneditable

    Event Name [Event Name] Noneditable, Need select fielddata from EventPopup (a popup view contains FMEventBizForm)

    Fee [Fee] Need select field from 2 values $15, $20.

  • 5/21/2018 Tutorial

    12/25

    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()

  • 5/21/2018 Tutorial

    13/25

    BizForm design (example cont.)

    Add FMRegist BizForm in OpenBiz Objects Browser

  • 5/21/2018 Tutorial

    14/25

    BizForm design (example cont.)

    Fill Attribute valueXML metadata file for FMRegist BizForm

    Use Edit Attributes frame:1. Click BizField icon to select a BizField of the Bizobj defined in root element

    2. Click BizForm icon to select a BizForm

  • 5/21/2018 Tutorial

    15/25

    BizView design

    BizView is the container of BizForms andother 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 ofother BizForm

  • 5/21/2018 Tutorial

    16/25

    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

  • 5/21/2018 Tutorial

    17/25

    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 FMRegistPlayer Id

    UI name of FMPlayerPlayer Id

  • 5/21/2018 Tutorial

    18/25

    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

  • 5/21/2018 Tutorial

    19/25

    BizView design (example cont.)

    Redesign FMRegist Because FMRegist depends on FMPlayer,

    the player shown on FMPlayer is same as

    the player shown on FMRegist. Itsreasonable to hide Player Name inFMRegist

    Hide Player Name in FMRegist

    Player Name [Player Name] Noneditable,Hidden

  • 5/21/2018 Tutorial

    20/25

    BizView design (example cont.)

    Add RegistView BizView in OpenBiz Objects Browser

  • 5/21/2018 Tutorial

    21/25

    BizView design (example cont.)

    Fill Attribute valueXML metadata file for RegistView BizView

    Use Edit Attributes frame:

    1. Click BizForm icon to select a BizForm2. Click Text icon to input long text

  • 5/21/2018 Tutorial

    22/25

    HTML Template design

    Typical templates Table templatea HTML table contains multiple

    BizForm records

    Group templatea HTML group contains singleBizForm record

    Other templates Tree template (todo)

    Special templates

    All templates must has format

  • 5/21/2018 Tutorial

    23/25

    HTML Template design (cont.)

    Data output from BizForm.Render {$title}, {$name} as value

    {$toolbar}, {$navbar} as array

    {$columns} as arrayfield labels/headers In table format

    {$cells} as 2D arrayfields values of multi-records

    {$selRow} as arraycurrent selected row flags

    In array format {$controls} as arrayfields values of a record

    These output variables can be used in yourtemplate files Please refer to http://smarty.php.net/for details

    http://smarty.php.net/http://smarty.php.net/
  • 5/21/2018 Tutorial

    24/25

    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)

  • 5/21/2018 Tutorial

    25/25

    Summary

    Development steps with OpenBiz

    Requirements

    Data model Create BizObj

    Create BizFormUser Interface

    Create BizView

    Create Templates