![]() |
OpenBiz provides a PHP framework that assists you to build complicated web application in an easy way.
OpenBiz is designed as a multi-layer architecture as the figure below.

Usually a business application can be modulated to 3 layers - Data layer, Business Logic layer and Presentation layer. In OpenBiz architecture, these 3 layers map to 3 packages, Presentation layer is refined to logic which is implemented by BizView package and GUI layers which is implemented by jbForm javascript package. Business Logic layer is implemented by BizObj package. 3rd party package ADODB handles Database layer.
A BizView contains 2 BizForm |
Click "Select" icon on a Field to show the BizPopup, then Select a record to populate the fields on the base form |
![]() Before sorting |
![]() After sorting on Name |
In Match View, Click Michael Liu |
![]() Link to Registration View with Michael Liu record |
Popup an BizForm and Select data to populate multiple fields on base BizForm
Registration BizForm depends on Player BizForm (RegForm.PlayerId = PlyForm.PlayerId)
Michael Liu is current selected player
Alan Chew is current selected player
Functionalities
This is an abstract database connection package which can connects to all major databases from different vendors. It can be downloaded from http://php.weblogs.com/ADODB
OpenBiz is written by PHP4 scripts, it runs at web server side. The typical running environment could be Web Server + PHP 4.x. To ensure the performance and reliability, we recommend users to use latest web server and php engine. For example
If you have the administrator permission, you can configure PHP running as an Apache module. Some php performance software, such as mmcache, works under Apache module. This url http://www.thesitewizard.com/archive/php4install.shtml is the guide to setting up PHP 4 to run with Apache on Windows.
For better performance, please enable dom xml extension under PHP4. Please refer to http://us4.php.net/domxml. domxml extension is required to run Design Studio.
Support web browsers - IE5.x, Netscape 7.x and Mozillar 1.x
Download the zip file and unzip it to a directory under your web access root.
Please read through the sysheader.inc under openbiz_root/ directory. Important notices:
Source tree structure:
openbiz_root/
---bin/ (openbiz php source)
------adodb/ (adodb package)
------configs/ (smarty config dir)
------fpdf/ (fpdf package)
------jpgraph/ (jpgraph package)
------Smarty/ (smarty package)
------templates/ (openbiz templates)
------templates_c/ (templates compiled code)
------tmpfiles/ (temporary file directory)
------usrlib/ (openbiz user library directory)
---css/ (openbiz style sheets)
---document/ (openbiz documents)
---images/ (openbiz images)
---log/ (openbiz logs)
---medata/ (openbiz metadata files)
------demo/ (demo package)
------design/ (design package)
---session (openbiz session files)
In Unix or Linux box, you need to give write permission to web users on log, metadata, session, bin/tmpfiles and bin/templates_c directories.
The following package are necessary - they are included in openbiz package
We recommend you install PHP optimization packages.
For Windows users who want to install Web Server + PHP + Openbiz, an installer is available since B10110. Please follow the steps below:
| What openbiz installer does? |
Uninstall Openbiz and AppServ
Both AppServ and Openbiz have uninstall program which can be run from
programs menu. Sometimes the Appache and Mysql services can't be uninstalled
by the uninstaller. Please use the trick below:
Clean up MySql command line:
> mysql-nt -- remove (remove the mysql windows service)
> del c:\winnt\my.ini (delete the mysql ini file)
Clean up Appache command line
> appache -u (remove the appache windos service)
OpenBiz is a perfect tool that help you develop your complicated web application easily and comprehensively. Based on its 3-layer architecture, your application will be on a clear logic model. It takes care the basic and advanced feature of the data-oriented application. In order to tell whether OpenBiz can help building your application, you need ask these questions:
If the answers are YES, OpenBiz is the right framework for developing your application!
Modeling your business data with Relational database tables is the necessary base for building your whole application.
Developers can choose use XML editor to edit medata files or use Openbiz Designer to visually edit metadata files. For more detail of Openbiz designer, Please refer to Openbiz designer user manual.
In a big application, user may need to build lots of objects, therefore they have big metadata file list. If they put these files under a single metadata directory, managing the metadata files is a painful thing. From openbiz 1.1, metadata files can be organized by package name. Bear in mind, metadata package is different with the (BizObj, BizView ...) packages which are the code units. Metadata package is a naming system, different package maps to different directory. It is like the package concept used in Java.
PackageX.PackageY.metaA.xml refers to the metaA.xml under META_PATH/PackageA/PackageB directory. Where META_PATH is the root metadata directory. This macro is defined in sysheader.inc with define ("META_PATH", "../metadata/").
3.1.1 How to configure package in metadata files?
Let's explain it with the demo example. After you unzip the source, find the demo directory under metadata directory. Open FMRegist.xml file with a text editor. You'll see a Package="demo" attribute in the BizForm element. This attribute is to say the default package of any type of openbiz object is under "demo" package. Here the openbiz objects refer to the following object types.
| Object Type | Referred as attributes in metadata files |
| BizObj | BizForm[BizObj] BizObj->BizFieldList->BizField[SelectBizObj] |
| BizForm | BizView->ControlList->Control[Form] BizView->ControlList->Control[SubCtrl] BizForm->BizCtrlList->BizCtrl[SelectFrom] |
| BizView | |
| BizPopup | BizForm->BizCtrlList->BizCtrl[SelectBizForm] |
| BizFormTree | Same as BizForm |
If an object name doesn't contain dot symbol ("."), the system uses the package attribute defined in the object root element as its package. Otherwise, if an object name has format as aaa.objectname, the system thinks such object under package "aaa" and will locate such object under aaa directory.
Go back to the example, you can find <BizForm Name="FMRegist" Package="demo" ... BizObj="BORegist"...>, <BizCtrl Name="reg_attdln" ... SelectBizForm="AttendeePopup"...> and <BizCtrl Name="reg_fee" ... SelectFrom="Selection(Fee)"...>. They all use default package, so the system will try to locate the metadata files as demo/BORegist.xml, demo/AttendeePopup.xml and demo/Selection.xml.
If you want to refer to an object under other package, just add the package name as the prefix of the object name. Notice, there're a Selection.xml under /demo directory and another Selection.xml under /design directory, they belong to different packages. In FMRegist, whose package is "demo", you can use <BizCtrl ... SelectFrom="design.Selection(Mode)" ...> to configure a comboBox whose values are from the "Mode" element of "design/Selection.xml".
3.1.2 How to configure package with Openbiz Design Tool?
From openbiz 1.1, in the object browser view of Design Tool, user can give "Package" name for each object. If the object is not found under the directory (META_PATH/package/) mapping to the given package, a sample metadata file (copied from object type template) is created under that directory. If no package name is specified, a sample metadata file (copied from object type template) is created under META_PATH/ directory.

If you have a complex application, you want to reuse the existing object to different places, but you want the object behave a little differently in different scenarios. Object inheritance will solve the above problem. Since in openbiz framework objects maps to metadata file, object inheritance becomes metadata file inheritance.
3.2.1 How to specify inheritance between metadata files?
Specify an object attribute, InheritFrom = "parent object name". For example, in demo application, BOEventX has <BizObj Name="BOEventX" Description="Event BizObj Extended from BOEvent" Package="demo" Class="BizObj" InheritFrom="demo.BOEvent"...>. This indicates that is BOEventX is inherited from BOEvent.
Metadata file inheritance is similar with class inheritance in programming languages, child object can inherit (if not defined in child object, but defined in parent object) or override (if same attribute defined in both child object and parent object) the parent object attributes.
| Object Type which can has inheritance | What CAN be inherited or overridden | What CANNOT be inherited - must be specified in child metadata file |
| BizObj | Object Attributes: Description, DBName,
Table, SearchRule, SortRule, OtherSQLRule, CacheMode
Object BizFieldList: BizField |
Object Attributes: Name, Package, Class, InheritFrom, DesignProfile |
| BizForm | Object Attributes: Description, jsClass,
Title, BizObj, PageSize, Width, Height, SearchRule
Object BizCtrlList: BizCtrl |
Object Attributes: Name, Package, Class, InheritFrom, DesignProfile |
Open design.htm in browser to access OpenBiz Design Studio. In
unix, make sure your metadata directory has write permission open for web
clients. Put focus on a record, click "Design" button
to modify the object xml file.

BizObj metadata file describes the mapping between database tables and BizObj. It's a xml file with following DTD.
<!--OpenBiz BizObj metadata DTD--> <!ELEMENT BizObj (BizFieldList) > <!ATTLIST BizObj Name CDATA #REQUIRED > <!ATTLIST BizObj Description CDATA #REQUIRED > <!ATTLIST BizObj Package CDATA #IMPLIED > <!ATTLIST BizObj Class CDATA #REQUIRED > <!ATTLIST BizObj InheritFrom CDATA #IMPLIED > <!ATTLIST BizObj Table CDATA #REQUIRED > <!ATTLIST BizObj SearchRule CDATA #IMPLIED > <!ATTLIST BizObj SortRule CDATA #IMPLIED > <!ATTLIST BizObj OtherSQLRule CDATA #IMPLIED > <!ATTLIST BizObj CacheMode CDATA #IMPLIED > <!ATTLIST BizObj DesignProfile CDATA #REQUIRED > <!ELEMENT BizFieldList (BizField+) > <!ELEMENT BizField EMPTY > <!ATTLIST BizField Name CDATA #REQUIRED > <!ATTLIST BizField BaseTable CDATA #REQUIRED > <!ATTLIST BizField BaseColumn CDATA #REQUIRED > <!ATTLIST BizField ForeignTable CDATA #IMPLIED > <!ATTLIST BizField ForeignColumn CDATA #IMPLIED > <!ATTLIST BizField ForeignPrimKey CDATA #IMPLIED > <!ATTLIST BizField SelectBizObj CDATA #IMPLIED > <!ATTLIST BizField SelectField CDATA #IMPLIED > <!ATTLIST BizField Type CDATA #IMPLIED > <!ATTLIST BizField Format CDATA #IMPLIED > <!ATTLIST BizField Required CDATA #IMPLIED > <!ATTLIST BizField Validator CDATA #IMPLIED > <!ATTLIST BizField Value CDATA #IMPLIED > |
Open Design Studio screenshot - BizObj Design. Click "Go Back to object
browser" button
to return to ObjBrowse View.

Important Notes:
3.4.1 Composite keys support
Most database table designers recommend each table have its unique primary key column which is also called ID column. In Openbiz BizObj, Id field is a required field for all BizObj. If table has ID column, it's easy to map such column to Id BizField. But there's still many tables are given composite keys. Openbiz provide the following solution to map composite keys to Id BizField.
On the Id BizField of a BizObj, user can specify >1 column names in the BaseColumn attribute. For example, <BizField Name="Id" ... BaseColumn="key1,key2,key3" ...>. But you need to make sure all BizFields mapping to the composite keys are marked as "Required='Y'".
3.4.2 Efficiently use memory by specifying cache mode
Openbiz leverages server side BizObj cache (storing database query results temporally) to maintain the session data so that users can feel smooth interaction just as they are using desktop rich client. But many web interfaces simply provide navigation only functionality. To help openbiz use memory efficiently, BizObj cache mode can be turned off. There're two ways to control the cache mode.
1) Set CacheMode attribute in BizObj metadata file. <BizObj Name=... CacheMode = "0|1" ...>. 0 means no cache is used, 1 means query data is cached. If no value is given, default cache mode = 1.
2) Call BizObj::Home($cacheMode) to reset the ResultSet and set the cache mode. The default $cacheMode is 1.
Keep in mind, no cache mode is suggested to be used in navigation only BizForm.
BizForm metadata file describes the mapping between BizObj and BizForm as well as other UI controls in BizForm. It's a xml file with following DTD.
<!--OpenBiz BizForm metadata DTD--> <!ELEMENT BizForm (BizCtrlList, TemplateList, Toolbar, Navbar) > <!ATTLIST BizForm Name CDATA #REQUIRED > <!ATTLIST BizForm Description CDATA #REQUIRED > <!ATTLIST BizForm Package CDATA #IMPLIED > <!ATTLIST BizForm Class CDATA #REQUIRED > <!ATTLIST BizForm InheritFrom CDATA #IMPLIED > <!ATTLIST BizForm jsClass CDATA #REQUIRED > <!ATTLIST BizForm Title CDATA #REQUIRED > <!ATTLIST BizForm BizObj CDATA #REQUIRED > <!ATTLIST BizForm PageSize CDATA #REQUIRED > <!ATTLIST BizForm SearchRule CDATA #IMPLIED > <!ATTLIST BizForm DesignProfile CDATA #REQUIRED > <!ELEMENT BizCtrlList (BizCtrl+) > <!ELEMENT BizCtrl EMPTY > <!ATTLIST BizCtrl Name CDATA #REQUIRED > <!ATTLIST BizCtrl FieldName CDATA #REQUIRED > <!ATTLIST BizCtrl DisplayName CDATA #REQUIRED > <!ATTLIST BizCtrl Type CDATA #IMPLIED > <!ATTLIST BizCtrl Width CDATA #IMPLIED > <!ATTLIST BizCtrl Height CDATA #IMPLIED > <!ATTLIST BizCtrl HTMLAttr CDATA #IMPLIED > <!ATTLIST BizCtrl Function CDATA #IMPLIED > <!ATTLIST BizCtrl Image CDATA #IMPLIED > <!ATTLIST BizCtrl Hidden (Y|N) "" > <!ATTLIST BizCtrl Enabled (Y|N) "" > <!ATTLIST BizCtrl Sortable (Y|N) "" > <!ATTLIST BizCtrl Order CDATA #IMPLIED > <!ATTLIST BizCtrl Style CDATA #IMPLIED > <!ATTLIST BizCtrl SelectBizForm CDATA #IMPLIED > <!ATTLIST BizCtrl SelectFrom CDATA #IMPLIED > <!ATTLIST BizCtrl DisplayMode CDATA #IMPLIED > <!ELEMENT DisplayModes (Mode+) > <!ELEMENT Mode EMPTY > <!ATTLIST Control Name CDATA #REQUIRED > <!ATTLIST Control Image CDATA #IMPLIED > <!ATTLIST Control Caption CDATA #REQUIRED > <!ATTLIST Control Type CDATA #REQUIRED > <!ATTLIST Control Width CDATA #IMPLIED > <!ATTLIST Control Height CDATA #IMPLIED > <!ATTLIST Control HTMLAttr CDATA #IMPLIED > <!ATTLIST Control Function CDATA #IMPLIED > <!ATTLIST Control Style CDATA #IMPLIED > <!ATTLIST Control Enabled (Y|N) "" > <!ATTLIST Control DisplayMode CDATA #IMPLIED > <!ATTLIST Control Access (READ|WRITE) "" > |
Open Design Studio screenshot - BizForm Design.

3.6 Build BizView metadata
BizView metadata file describes the BizForms and their relationship in the BizView. It's a xml file with following DTD.
<!--OpenBiz BizView metadata DTD-->
<!ELEMENT BizView (ControlList) >
<!ATTLIST BizView Name CDATA #REQUIRED >
<!ATTLIST BizView Description CDATA #REQUIRED >
<!ATTLIST BizView Package CDATA #IMPLIED >
<!ATTLIST BizView Class CDATA #IMPLIED >
<!ATTLIST BizView Template CDATA #IMPLIED >
<!ATTLIST BizView AccessControl CDATA #IMPLIED >
<!ATTLIST BizView DesignProfile CDATA #REQUIRED >
<!ELEMENT ControlList (Control+) >
<!ELEMENT Control EMPTY >
<!ATTLIST Control Name CDATA #REQUIRED >
<!ATTLIST Control Form CDATA #REQUIRED >
<!ATTLIST Control SubCtrls CDATA #IMPLIED >
<!ATTLIST Control Dependency CDATA #IMPLIED > |
Open Design Studio screenshot - BizView Design.

BizPopup is a special BizView. It has only one BizForm and uses BizForm.dtd file as its XML schema. Because the BizPopup is mainly used in record selection, it makes sense to provide only navigation and query for its BizForm, meanwhile only need to show most critical columns.
Open Design Studio screenshot - BizPopup Design

BizFormTree is a special BizForm. It uses BizForm.dtd file as its XML schema. BizFormTree is designed to represent the tree hierarchy relationship within a database table.
For example, event table schema: (every record has PARENT_ID and CHILD_FLAG columns which build tree hierarchy relationship between the records in the same table)
| Column | Comments |
| SYSID | Primary key |
| NAME | Event name |
| PARENT_ID | Store the SYSID of its parent event. |
| CHILD_FLAG | Flag that indicates whether this record has child record or not |
Open Design Studio screenshot - BizFormTree Design

To build up a BizFormTree metadata, please the following xml elements are necessary
See screenshot here
The main xml schema (DTD files) won't get changed, but xml element's attributes can be changed (adding a new attribute or remove an old attribute) along the OpenBiz development. To assist OpenBiz customers to update their existing xml files easily, a new button is introduced since B10105.

The button in the red circle is to update the xml element from the current xml schema, meanwhile the existing attributes data is kept. This button can only upgrade the attributes in single xml element. Put focus on an element and click the upgrade button. Then repeat it on another element.
Smarty template engine is used in OpenBiz to render the HTML output. We provides some basic templates for render BizForm and BizView. You can create your own templates. Remember that an openbiz form must begin with a form tag <form id={$name} name={$name}>. For detail, please refer to http://smarty.php.net/docs.php
From B10109, draw a BizForm as a html table is easy.
In
BizForm xml file, you need give DataFormat as "htmltable" and
FormatStyle as "table style, table header style, table odd row style, table
even row style, table selected row style>
<Mode ... TemplateFile="list.tpl" ... DataFormat="htmltable"
FormatStyle="tbl,tbl_head,tbl_rowodd,tbl_roweven,tbl_rowsel,tbl_cell"/>
In template file, {$fmttable}represents form whole html table.
Please refer to demo files FMEvent.xml and list.tpl
From B10109, draw a BizForm as a set of controls is more flexisible.
Since the array dataformat output to smarty template is associated array, user can easily layout controls by their names.
Please refer to demo files FMEvent.xml and edit.tpl
You can configure a BizCtrl associated with a hyperlink which changes current view to another view who has the detailed information of that BizCtrl.
In a BizForm, set a LinkTo attribute of a BizCtrl. Syntax is LinkTo="OtherView.OtherBizForm.OtherBizCtrl=MyBizCtrl".
OtherView - a view name the link takes to;
OtherBizForm - an independent BizForm, who is not a subctrl of any other
BizForm, in OtherView;
OtherBizCtrl - a BizCtrl of OtherBizForm
MyBizCtrl - a BizCtrl in current BizForm
Please see the example in demo xml files (FMMatch, RegistView, FMPlayer). In this example, a link is associated with player name. This link changes view to RegistView with the player's detail. Click here to see the screenshot.
5.2.1 Bind static list to comboBox
In your BizForm, you assign SelectFrom="Selection(Fee)" for a BizCtrl, which means this
field control is a comboBox whose data is from the "Fee" elements in Selection.xml file. Please see example in
demo FMRegist.xml where BizCtrl reg_fee is defined as a comboBox.
<Selection>
<Fee Value=""/>
<Fee Value="15"/>
<Fee Value="20"/>
</Selection>
Also, you can give both value and text. If only give value, openbiz uses the
value as the display text.
<Selection>
<ChartOption Value="AAA" Text="BarLine Chart"/>
<ChartOption Value="BBB" Text="Pie Chart"/>
<ChartOption Value="CCC" Text="GroupBar Chart"/>
</Selection>
You can make up your own xml file that has list of values for selection.
5.2.2 Bind dynamic list (Table column) to comboBox
In your BizForm, you assign SelectFrom="BizObjName[BizFieldName]" for a BizCtrl, which means this field control is a comboBox whose data is from the table column mapping to the BizFieldName of the BizObjName. To avoid same values appear in the comboBox, you need to make sure the BizObj query returns an unique list.
| BizCtrl/BizForm | BizField/BizObj | |
| Base BizForm | Ctrl_1/FM_1 | Fld_1/BO_1 |
| Popup BizForm | Ctrl_2/FM_2 | Fld_2/BO_2 |
You can define the dependency relationship between BizForms in a same view. Records in a child BizForm is dynamically changed along the record change on it parent BizForm. Such relationship is defined in BizView xml file.
<BizView ... >
<ControlList>
<Control Name="fm_1" Form="ParentForm"
SubCtrls="ChildForm"/>
<Control Name="fm_2" Form="ChildForm"
Dependency="ChildBizCtrl=ParentForm.ParentBizCtrl"/>
</ControlList>
</BizView>
Please see the exmaple in demo xml files - RegistView.xml. It defines that Registration BizForm depends on Player BizForm (RegForm.PlayerId = PlyForm.PlayerId). Click here to see the screenshot.
5.5.1 Openbiz support following data types and formats (attributes of BizField)
| Type | Format | Syntax | Format Example |
| Text | none | ||
| Number | format supported by printf | <BizField ... Type="Number" Format="%..." ...> | %5.2f to print a float number |
| "Int" - integer format according locale | <BizField ... Type="Number" Format="Int" ...> | If locale=enu, 12345.678 is displayed as 12,346 | |
| "Float"- float format according locale | <BizField ... Type="Number" Format="Float" ...> | If locale=enu, 12345.678 is displayed as 12,345.68 | |
| Date | In default read-only mode, a date can be formatted according to the Date format. | <BizField ... Type="Date" Format="date format" ...> | 6/21/2003 can be formatted as %A, %b %d %Y - Saturday, Jun 21 2003 if system locale is enu |
| In edit/query mode, a date is formatted as YYYY-MM-DD (ISO 8601) | 12/31/2003 can be formatted as 2003-12-31 | ||
| Datetime | In default read-only mode, a date can be formatted according to the Date format. | <BizField ... Type="Datetime" Format="datetime format" ...> | 6/22/2003 9:30am can be formatted as %m/%d/%Y %H:%M:%S - 06/22/2003 09:30:00 if system locale is enu |
| In edit/query mode, a date is formatted as YYYY-MM-DD hh:mm:ss (ISO 8601) | 6/22/2003 9:30am can be formatted as 2003-06-22 09:30:00 |
||
| Currency | Formatted according to locale setting | <BizField ... Type="Currency" Format="Currency" ...> | 1456.89 is formatted as $1,456.89 (enu) 1456.89 is formatted as F1 456,89 (fra) |
| Phone | Formatted according to given mask # | <BizField ... Type="Phone" Format="mask string" ...> | 1234567890 is formatted as mask=(###) ###-####, phone=(123) 456-7890 mask=###-###-####, phone=123-456-7890 |
| If a phone number starting with "*", it represents international phone number, it won't be formatted | *123 4567890 is treated as international number |
5.5.2 Openbiz support following data validations
| Validation Type | Example |
| Required - indicates the field can not be empty | <BizField Name="Name" Required="Y" BaseTable="players" BaseColumn="NAME"/> |
| Validator - php statments that returns a boolean value | <BizField Name="Fee" Type="Currency" Format="Currency" Validator="return [Fee]>=15;" BaseTable="regist" BaseColumn="FEE"> |
From B10107, customer can present their data with various HTML elements by specifying element type and attributes in BizForm xml files. HTML elements are displayed in edit/query modes
|
Attributes of FieldControl element in BizForm |
|||||||||
| Type | Width | Height | HTMLAttr* | Style** | SeclectFrom | Caption | Function | Image | Comments |
| Text | x | x | x |
x | x OnChange |
Single line text input. Default type | |||
| Textarea | x | x | x | x | x OnChange |
Multi-line Text input | |||
| ListBox | x | x | x |
x | x |
x OnChange |
ListBox or ComboBox | ||
| CheckBox | x | x | x | x | x |
x OnClick |
CheckBox | ||
| Radio | x |
x | x | x | x |
x OnClick |
Radio buttons | ||
| HTMLButton | x | x | x | x | x | x OnClick |
Standard HTML Button | ||
| SubmitButton | x | x | x | x | x | x OnClick |
Standard HTML Submit Button | ||
| ResetButton | x | x | x | x | x | x OnClick |
Standard HTML Reset Button | ||
| Password | x | x | x | x | HTML password | ||||
| Button | x | x | x | x | x | x OnClick |
x | OpenBiz image button | |
| Date | x | x | x | x | Textbox with date picker icon | ||||
| Datetime | x | x | x | x | Textbox with datetime picker icon | ||||
| HTMLBlock | x | x | x | x |
Caption is treated as HTML block | ||||
| FunctionColumn | x | x | x | x | x | x | This type doesn't map to a data field | ||
* HTMLAttr field can contain any valid additional HTML attribute applied on the HTML element type
** Style field can contain any valid style properties (css)
HTMLAttr="maxlength=N" to limit the maximum number of characters that the user can enter in a text control.
By default show comboBox. If HTMLAttr="size=N", show N-row listbox.
SelectFrom="XmlFile(Key)" means this field control is a listbox or radio buttons whose data is from the "Key" elements in XmlFile.
SelectFrom="Value" means this checkbox returns the Value when user check the checkbox.
By default the radion buttons are arranged horiztionally. If HTMLAttr="wide=1", you can force them arranged vertically.
"<" and ">" used in HTML block have to be replaced by "<" and ">".
You can assign a BizField with SQL functions provided by the database engine. The syntax is
<BizField Name="FieldName" BaseTable="TableName" BaseColumn="FUNC(ColumnName)"...>
For example:
<BizField Name="SumFee" BaseTable="regist" BaseColumn="SUM(FEE)"...>
| Syntax | Example | |
| SearchRule | SearchRule = SQL Where clause* | SearchRule = "[LastName]='Yao' OR [FirstName]='James'" |
| SortRule | SortRule = SQL Order By clause* | SortRule = "[Id] ASC" |
| OtherSQLRule | OtherSQLRule = any SQL clause* | OtherSQLRule = "GROUP BY [EvtId] HAVING [SumFee]>10" |
* Replace the Column name with BizField name.
The most useful client side javascript function is GoToView(view, rule, loadPageTarget).
| Argument | Description | Sample |
| view | the view name | |
| rule | the search rule of a bizform who is not depent on (a subctrl
of) another bizform
syntax is "form.ctrl operator value". |
FMSponsor.spr_exp>=12000
FMSponsor.spr_name=\'Midas Auto\' OR FMSponsor.spr_id=\'SPSR_2\' FMSponsor.spr_name LIKE \'S%\' |
| loadPageTarget | the window or frame target to load the page |
In the demo application, EvtMenu.htm consists of a list of hyperlinks that call GoToView functions.
OpenBiz provide many functionalities to building a complicated web application. But different application has different requirement, so you may extend OpenBiz packages to build customer oriented application.
Because OpenBiz packages are based on object-oriented design, you can easily build up your own object by extending these packages and inherit all useful functions provided by them.
Since B10107, extended classes are automatically loaded on demand. Customers can put their library files under /bin or /bin/usrlib/. Extended class must be included in a file with format as ClassName.php.
/**
* class BOUser is the BizObj class to implement USER logic object
*/
class BOUser extends BizObj
{
function
BOUser($xmlFile=null) {}
function
my_special_function() {} // new function
}
/**
* class FMUser is the BizForm class to implement USER UI object
*/
class FMUser extends
BizForm
{
function
FMUser($xmlFile=null) {}
function my_special_function() {} // new function
function
Render() {} // override Render()
}
From openbiz 1.1, customer can write their special logic by implement Plug-in Service Interface.
class chartService
{
function chartService() {}
function render($objname, $inputDataStr)
{
$kvArray = ExtractInputToArray($inputDataStr);
$chartName = $kvArray['__this']; // get the value of the control that issues the call
// get the current UI bizobj and its querySQL, create a new bizobj and search with the same sql
$bizform = &sys_getobj($objname); // get the existing bizform object
// copy to a new bizobj, not touch the bizobj belong to UI, syntax may change in PHP5
$bizobj = $bizform->m_BizObj;
...
}
Three examples can be found in bin/usrlib/
By assigning a customer function call to the "AccessControl" attribute of BizView, access control can be added to a view. The syntax is
<BizView ... AccessControl="ClassName.MethodName"...>
Or <BizView ... AccessControl="I"...>. If I=0 access denied; if I=1 view readonly; if I=2 view is read+write.
You can control the access level of each control by assign "Access" attribute (READ/WRITE) to a control in BizForm. If no Access attribute is given, openbiz treates it have "WRITE" permission.
<Control Name="SearchButton" ... Access="READ">
<Control Name="EditButton" ... Access="WRITE">
Then implement this function call as a class method with a input argument as view name. The function should return an integer value.
| Return Value | Meaning |
| 0 | Cannot access the view. System will show an error page "viewdenied.tpl" |
| 1 | View is read-only |
| 2 | View is editable |
/*
Example: method CanAccessView
of
class ViewControl.
BizView config as AccessControl="ViewControl.CanAccessView"
*/
function
CanAccessView($view)
{
//$userid = _SESSION["login"];
//check if this user can access this view
//if view is not accessible
// echo "$view is not accessible!";
// exit;
//else
// return; // (0,1,2) - (no view, read, write)
}
OpenBiz API Document is generated by PhpDocumentor http://phpdocu.sourceforge.net/