A new document called "Advanced H2O Form Development" is available for download from www.OnyakTech.com. This document contains the following and will continue to expand in the future...
- H2O Basics: A general overview of the H2O Design
- Getting Started Fast Tips
- Step By Step instructions on creating forms and adding controls
- Securing Form Fields by DNN Role
- Validating User Input
- Control Type Specifics
- H2O Scripting
Some samples of information in the document...
H2O Basics
Basically put, H2O allows you to create custom forms in DotNetNuke. But it does much more than that. It gives you the ability to turn a form into much more then just a way to collect data.
Forms in H2O are like modules in DotNetNuke. You must have DotNetNuke before you can have the module. Forms in H2O define an interface; however it's data (unless connected to an external table) is stored locally within a project. Any changes to that data are also stored against the project. All security, teams, sub-forms, etc....all tied to the project.
This design allows you to quickly build applications within DNN and maintain the forms independence from the project (so that you can re-use the form in other projects or even as sub-forms in a project). By using “Quick Entry” and other related options in the configurations of H2O, you can setup H2O to display a single form very easily and have it presented to the user as if it's not attached to any projects.
The primary original purpose of H2O was to provide a custom forms module that was not limited to XML, which suffers from database searching and a performance loss. We also didn’t want to make it mandatory to know database programming. This resulted in H2O storing it’s data in its own tables while also giving you the option to automatically synchronize with tables in your database. Simply put…
· You can create H2O forms from scratch that have no connections to existing tables in your database.
· You can create H2O forms that are connected to an existing table. Any changes in that table will update your H2O project. Any changes in your H2O project will update the existing table.
· You can create H2O forms that are connected to an existing table and also have controls that pull data from other tables. For example, you may have a User Profile form that displays data on the current user and then also have a data grid that shows the user their recent purchases.
· You can have H2O automatically create a form for you by specifying an existing table. This form can then be left as is or connected to that table for automatic synchronization.
· You can create an H2O form that contains only scripting (Java or H2O). Useful for redirecting users to a specific page based on the region specified in their profile. Or displaying a pop-up advertisement with advanced graphics using Java.
There are four areas to understand in H2O:
1. Forms: Contain the visual appearance, fields, data synchronization configurations, script and logic commands for H2O. These can be downloaded for use on any H2O installation, assigned to an H2O project or as a sub-form in an H2O project.
2. Teams: A collection of DNN Users that are assigned to one or more H2O Projects for the primary purpose of identifying security rights at a group level. Teams can be quickly populated by specifying a Role to import users from.
3. Projects: Projects are a container for your H2O forms that provide meta-data and additional processing. For example, if you created an article form you would use the project to allow visitors to post comments, create a custom view of your articles, filter your articles, assign security, etc. Your forms must be assigned to a project for them to function.
4. Module Configurations: This is where you configure how H2O will be presented to the user and how the projects and forms will be used. For example, you could configure H2O to simply display just a single H2O form and nothing else, or display a menu of all projects in your system with icons, or display a list of posted forms in a project and allowing the user to drill down into the form details, etc.
...
Getting Started Fast
To get started quickly, log-on to www.OnyakTech.com and download H2O Forms from the Repository. These are simple forms but should get you going and give you an idea of can be done.
Another great way to get started (especially if you need to build a form with a lot of fields) is to first create a table in SQL Server that contains all the fields you will want your form to contain. Then, create a new form in H2O by entering the name of the table you just created as the Form Name and click the Generate From Table link. H2O will then create your form with all fields and labels as well as having it properly formatted.
...
Control Type Specifics
· Data Grid: Enter your SQL Statement into the H2O Script field. All fields returned will be displayed. This control does not contain any formatting by default, so you may also want to specify CSS in the CSS Class field to improve the visual appearance of your data grid.
...
H2O Scripting
The H2O Scripting field is used for several purposes. In this field you will enter SQL Statements, Java/VB Script and H2O Commands.
Note that H2O Commands and H2O Tags are completely different.
An H2O Command is used by itself with parameters following it. For example, if you entered the following into the H2O Script field for any control “COM_SETNAME=Register”, when your form is rendered the Save button will have it’s displayed text changed to Register.
An H2O Tag is used in SQL Statements and Java/VB Scripts in the H2O Script field to inform H2O that it should replace that H2O Tag with a dynamic value. For example, the following SQL Statement “Select * From Users Where UserID = [USR_USERID]” will be changed to match the current users User ID and then executed. Resulting in “Select * From Users Where UserID = 584”
The following H2O Commands are not control specific. They are used for additional form functionality. You can use these commands on a control that is not using the H2O Script field or assign it to a hidden Label control.
· COM_SETNAME: Changes the text displayed on the Save button in H2O. Ex:”COM_SETNAME=Register”
· COM_GRANTROLE: Will assign the user completing the form to a specific DNN Role once they complete the form. Ex: “COM_GRANTROLE=SigmaPlusSource”
· COM_REDIRECTBYROLE: Will redirect the user to a specified URL if they belong to a specific Role. The first parameter after the command is the name of the role followed by a “>” character and then the URL to redirect them to. Ex:”COM_REDIRECTBYROLE=Administrators>http://www.OnyakTech.com”
· COM_REDIRECTBYAFFILIATEID: Will redirect the user to a specified URL based on their affiliate id in their DNN User Profile. The first parameter after the command is the affiliate ID followed by a “>” character and then the URL to redirect them to. Ex:”COM_REDIRECTBYAFFILIATEID=1525>http://www.OnyakTech.com”
COM_REDIRECTBYREGION: Will redirect the user to a specified URL based on their region in their DNN User Profile. The first parameter after the command is ......
Download the complete document from www.OnyakTech.com