|
Introduction
The Multiformity engine consists of controls that are easy to configure, and accommodates many of the common needs for a web application that connects to a database. It automatically provides the abilities to add, edit and read data, as well as includes integrated help, treeview and scheduling controls and many other functionalities.
Note: The code has been converted and upgraded to ASP.NET 2.0 :D.
The purpose of this toolset is to allow for your development team to focus on the "rocket science" behind a specific project, rather than the mundane, day to day details of the given application. Below are a few screenshots of the inherent functionality of this system:
Integrated Treeview

Edit/Add Form Generation

Snazzy Grid Control

Features
The Multiformity engine currently supports (Note: this is not a complete list, that would be too long for this article ;):
- NEW Ability to edit or delete multiple rows at once through filtering.
- NEW Tabbed edit forms are now accomplished by merely configuring fields in the database through the standard edit forms.
- NEW Integrated security is now complete. Through the standard web interface you can create user groups that specify if the user has access to see or edit any table or field in the database. It additionally supports group inheritance.
- NEW Added in
MultiListbox control for long multi select listboxes, also allows ordering of the data.
- Process Automation allows for these controls to be grouped together in a procedural fashion. With little or sometimes no additional coding and recompiling, you can build procedures to email customer lists, create a sale out of inventory and log payment, or update a central server.
- NEW Treeview is now a control, not a collection of four frame pages.
- NEW Reduced Database hits by over 75% and CPU usage by 50%. Sometimes requires that the ASPNet_wp process be killed when debugging ;)
- NEW
UserInformation object stores all of the data associated with a user, and is accessible through any page that inherits BasePage.cs automatically.
- Fixed look and feel in FireFox.
- One to many relationships between tables in your database are detected and new features are automatically made available.
- Regular expression validation, without the need to recompile code.
- An enhanced grid object that supports sorting, paging and filtering with no setup.
- A Form object, that given a table's name from the database, and an optional row identifier, will automatically generate the appropriate add or edit form, all with customizable taborders, as well as contact sensitive help, tooltips and validation built in. The form will even group together similar controls (checkboxes, dates, etc.).
- Integrated Help for both administrators and developers, as well as for your end application. All of which is maintained through the standard web interface.
- Easy to use class library that will allow for your developers and graphic designers to separate form from function, with seamless integration between raw HTML and the standard code-behind files.
- Plus too many other features to name. There are over 60 classes, including 14 custom controls, extensive SQL tools, and default implementations of all of these controls.
One of the features that makes the Multiformity engine better than your average grid control or databound text box is that they are all inter-related. For example the Grid control displays links that go to pages that display the other controls like the record viewer or form. The grid control also uses a form object to implement its own filter functionality; the treeview uses a record viewer to display row contents. Additionally, these larger controls also use the smaller and simpler "form" controls that also refer to the larger controls. Read on for a partial list of controls currently available:
| Control |
Description |
ProcessViewer |
Displays the current step for a process, as well as a way to return to any previous step. This control is used as part of the process automation framework, which gives the developer the ability to quickly string many of these components and other custom components together to complete a task using systematic steps. |
TreeView |
A TreeView control displays tables from the database where the tables have a one to many relationship, allowing a treeview concept. For example, the integrated help system utilizes a treeview control to display the help topics on the left hand side, with the topic content displayed on the right. This could also be used to display items in an inventory grouped by manufacturer, or color, or many other factors. |
Form |
Used to add or edit data to the database. It contains all of the add/update, cancel and delete buttons for the appropriate situation. |
Grid |
The Grid object needs to do nothing else except display the user that will be accessing the data, and the table that the user wishes to see. It automatically filters, sorts and pages, all the while maintaining state. Contains links to all the appropriate edit/add forms and to some other useful links. |
PropertiesEditor |
Edits a text file with the extension of .properties and contains name value pairs separated by equal signs. This toolset was designed with the purpose of not needing to update code and compile in order to make many minor and some major types of customizations. Editing various properties on the server through the web site makes it easy to accomplish a lot of these goals. |
RecordViewer |
Views a record of data, expanding any large text field to be read in full on the page. |
Button |
A Button is actually a placeholder, either with a button, link or an image on it, and it can either have simply a link to redirect to, or an event handler assigned to its click. |
Calendar |
Contains three controls. The default Calendar control, a button and a textbox. The button will hide and/or show the calendar control, and clicking a date in the calendar will place the selected date into the textbox. |
CheckBox |
Implements a "True/False/Default" implementation of a checkbox using JavaScript and images. |
DropDown |
Contains a dropdown and a button. Clicking the button will open the default grid displaying the linked table. |
MultiSelect |
Contains two multiselect dropdown lists with move one or all buttons to move the source list to the selected target lists. This control is databound, and saves and reads the result into the database as a comma separated list. |
TextBox |
Provides a basic databound Textbox |
In addition to these features, Multiformity is a breeze to use and setup. We only suggest that you read the readme and other documentation before trying to utilize these tools with your existing databases, as we have a naming convention that we use that allows for the "defaults" to kick in. You do not have to use our naming conventions, but it will require a bit more setup otherwise.
Using the code
Utilizing the code is rather easy, and entails many of the specifics that any developer will have to account for in their custom projects. Things like absolute paths to system directories, DSN strings, and other similar things do need to be configured, which I will detail in the following sections.
For a full information on how to use the code, you can read the documentation included in the source zip file (multiformity.chm). For a brief rundown on the basics:
To display a grid on a page: using System.Web.UI.WebControls;
using rasp.Components.HTML.PageControls;
public class Display : rasp.Components.BasePage {
...
PlaceHolder ph = (PlaceHolder)FindControl("Grid");
Grid wc = new Grid(this, this.UserInformation);
ph.Controls.Add(wc.TheGrid);
You will probably notice that there are really only six lines of code here, the rest is just commenting...
To display the edit form: using System.Web.UI.WebControls;
using rasp.Components.HTML.PageControls;
public class Edit : rasp.Components.BasePage {
...
PlaceHolder EditForm = (PlaceHolder)FindControl("EditForm");
Form f = new Form(this, this.UserInformation);
EditForm.Controls.Add(f.RecordEditor);
Most of the other controls are similar to this, but I won't bore you with those details, but it is important to note again that there are just six lines of code to display an edit form.
Now, let's see how you do some really cool stuff. The form control that I have created automatically generates databound controls, it additionally will automatically sort the controls and place them on the tabs for you, but there may be a situation where you need to display a "custom" edit or add form for a particular table (if not all of them). This is the classic "separating form from control" situation, you have web designers that design the look and feel of a page, but don't know much about how to create a databound control programmatically. For this I have provided another class that inherits from the BasePage class that automatically finds a place to put the controls for the form. With this architecture, the web designer can simply put in <asp:placeholder> tags that designate the control to be obtained from the DB. I will be improving on this concept later, but for now, here is how it works:
The ASPX Page: <%@ Page language="c#" Codebehind="EditRow.aspx.cs"
AutoEventWireup="false" Inherits="EditRow.cs" %>
<HTML>
<HEAD>
<title>EditField</title>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="EditField" method="post" runat="server">
<table>
<tr><td>
<asp:PlaceHolder ID=Form_Name Runat="server" />
</td><td>
<asp:PlaceHolder ID=Form_Caption Runat="server" />
</td></tr>
<tr><td>
<asp:PlaceHolder ID="Form_Submit_Button" Runat="server" />
</td></tr>
</table>
</form>
</body>
</HTML>
Note here that the IDs of the placeholders are the field names preceded by "Form_", it's that simple!
The code-behind file: ...
public class EditRow : FormPage {
...
private void Page_Load(object sender, System.EventArgs e) {
this._Adapter = "TableName";
this.PopulateControls(this);
}
...
The base class in question (FormPage.cs) is a little specific to explain here, but I will simply state that it has the protected _Adapter string member, and with that figures out where to place the desired controls designated by the IDs of the placeholders in the ASPX file.
This way, edit pages can be created by web designers rather than web developers.
Installation
Files included in download:
Points of Interest
Dynamic creation of databound HTML controls is a topic that is not covered by many, if any books or online references. I have, however learned much about the topic, and plan on writing about my findings at a later date when I get some time, so keep an eye out for those articles! Email me at Multiformity@austin.rr.com for a current status of where I am with my articles, as I plan on writing many in the near future!
History
This is the second release of the Multiformity engine, further development depends on the community, so please donate and it will come back to you tenfold!
Icons for the Multiformity engine were graciously donated by the folks at Ace Icons, a division of Can Do Software. They are the one stop for all of your icon and graphic needs. Please support our partner and purchase a set of icons to keep the look and feel of Multiformity consistent in your projects.
Multiformity is an open source project. We welcome any feedback and new code that the community would wish to share, but it is not required. This toolset is released under the GNU public license, which means that you can utilize it in any public or private project. We do however appreciate any improvements that can be incorporated back into the source ... Share the love ;). Again though, since the icons were donated, please be mindful of that, and utilize Ace Icons for any graphic needs that you may have. The reason that I have released this project as open source is because it is now too much for me to handle at once.
| You must Sign In to use this message board. |
|
| | Msgs 1 to 22 of 22 (Total in Forum: 22) (Refresh) | FirstPrevNext |
|
 |
|
|
Dear AB,
Thanks for your ideas. I luv it.
I tried to this project many time. and also I cannot re-build via VS2005. I did many thing, and now, I got this error all the times.
You need to have a Primary key on the table: _HELP
Any ideas ?
I createa an empty database, import your data file (I use express 2005). and import Northwind, all table that I would like to use the last icon, I got the above error
Thanks for your help
Do you have any project which use this framework ?
Regards,
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
This is more than just adding grids and stuff to a page...
I thought that the article explains it all, I am having to re-iterate what was already said I guess. Features like integrated security (including login, table and even field security), integrated help, process automation and many other features make this a unique toolset. Creating databound controls on a page takes about 3 lines with this toolkit. This code looks at your database and knows if something should be a date dropdown, a checkbox, even a databound dropdown that links to another table. Things like field formats (IE a textarea versus a textbox) and validators are built in. It is much more than the standard controls that are included in .Net 2.0.
With the standard controls, things like field headers for your grids, datasources for dropdowns and many other things still need to be configured over and over again for each page. Multiformity contains a large amount of metadata in the database, allowing you to manipulate many of the things that historicaly would have required a re-compile of the code from the website itself.
Additionally, I have used some of the new ASP.net controls, seeing if I can integrate them into Multiformity, and while they are now actually capable of doing what I wanted to do originally, I have already gotten what I have, so there is no reason to upgrade to the new controls. Again, putting a grid on a page, or creating a form with dynamic custom databound controls only takes about 5 lines of code, try that with the new asp.net controls and let me know what you find 
AB
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Andrew,
I think its a very good idea to have tools like this. I appreciate your effort. Can you give me an idea how can i start using this?
Thanks Sakthi
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
Well the first step is to get it installed 
After that you can import your own database tables, then in the admin tools page you can initialize the Multiformity metadata tables by clicking on the "Initialize System Tables" button. Then go in and edit the "_Tables" and "_Fields" tables to put in your own field/table captions, tooltips etc. Then if you want to have integrated help for your project, add in the help topics in the _Helps table.
Go into _Users to utilize the integrated security. In there you can hide tables and fields, or make tables and fields read only for each individual login.
Then you can look into changing the look and feel for the site by creating your own header object and changind the other ASPX to match the look and feel of the site that you want to make.
Feel free to email me directly at multiformity@gmail.com if you have any other questions .
AB
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Very good, Has some interesting concepts.
Could it be extended to include XAML support? I am seeing this world where The same designed XAML form can be used to develop a Web form and windows form from the same definition, It simple to render HTML from XAML using Transformations, but the fun bit would be to generate a Web Form with WebControls etc that can be picked up from the .NET Code.
I am working on a project at the moment and have something where XAML-Like Files are parsed and WebForms are generated dynamically, its for a Survey Application. The next step would be to employee code-generation as well.
Very good! JC
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Yes it could be extended I am sure, I am the only one working on this currently though so I don't really have that kind of time. I will look into this some more, I am currently getting ready to implement some AJAX functionality as my first step, but what you speak of would be a logical next step 
The process Automation Framework that I have in here would work out reasonably well for your survey application BTW. I have additionally considered making a list form where all of the fields are simply listed 1 - N going down the page. Haven't gotten around to that yet, but I will eventually, won't be too hard to do 
Thank you for your feedback, did you manage to get the code running on your machine or are you just going by the article text? I am always looking for more feedback and suggestions!
AB
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I think i have the same problem as mtone,i can't enjoy your "Rapid Web Application Development" because i can't connect the SQL server.Error like this : SQL Server not exist or accessing refused
行 153: if (conn.State != System.Data.ConnectionState.Open) { 行 154: conn.Open(); 行 155: } 行 156: return conn;
I want to hear from you as soon as possible ,Thank you!
殳儿
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Oh,Maybe i didn't express my question clearly,Can i repeat my question? I usually connect SQL Server by add codes as follows : in my Webconfig file, But in your programme's webconfig file i don't find these codes,and i guest you use : mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="20" /> to connect DB,is it right or not? And the thing which i feel strange is how to setup the DSN and where you transfer this information in your programme . By the way ,I am come from china ,my English is too poor to express my question , I want to hear from you as soon as possible ,Thank you! My E-mail address:zhoujian@cug.edu.cn
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I made my own config file located in (by default) in c:\inetpub\wwwroot\rasp\contants.properties (You can just edit this file in notepad). In there you will notice the main two things that need to be configured for the code to work. There is a DSN and BaseURL in there to configure. Simply put in a DSN String that will connect to the database that I provided and you should be all set.
I made my own properties file for a few reasons, but mainly because I like to have more control over how the connection is made to the database, as well as store information that cannot be set in the web.config file.
These instructions are in the article by the way 
AB
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Thank you for your reply! I found this file(contants.properties)and modified it,but failed again ,I think i still didn't understand these code in this file.
I tried as follows: DSN=MyDSN; Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=RASP;Data Source=LML;Packet Size=4096;Workstation ID=LML BaseURL=http://localhost/rasp (MyDSN is the System DSN in my ODBC Settings in my administrative tools) (LML is my system's name ,oh ,my system is Windows 2000 server family) I don't know what's mean of "Integrated Security=SSPI","Persist Security Info=True","Initial Catalog=RASP" , "Packet Size=4096" and "BaseURL=http://localhost/rasp" .Can you tell me?
I am sorry to bother you so much!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
DSN is the property name, so you would need (on one line)
DSN=DSN=MyDSN;
Although, I would just suggest changing the Initial Catalog and WorkstationID in the DSN that was provided. The initial catalog is the database that you will be using (my DB is called rasp, but you can attach it as any name you wish). The Integrated Security setting indicates that SQL Server should authenticate against the built in user for ASP.Net (which is MachineName\aspnet). If you want to use a different username and password, then you will have to use the method I described in a previous post to mtone.
The packet size and persisit security info properties were simply added in to my DSN by Visual Studio.net when I told it to create my DSN string, so I am sure that they are usefull somehow, but now nessicary to make a connection.
The BaseURL property is used to define what the root URL is of the site. For example, if you were to install this to a public server, the baseURL could be
BaseURL=http://www2.mycode.com/samples/rasp
but in a test environment, on your computer, as long as you have kept the name defaults correct, the current setting
BaseURL=http://localhost/rasp
should work. This is used because many places in the code build off of this base url, sometimes many folders deeper than the base, so this needs to be correct in order for all of the linking to work from page to page. I had it using relative URL's in the past, but it got too complicated, and relative paths didn't always work in the case of the header code (where the header could appear in pages ranging in many depths of the folder structure).
For further reference on connection strings, see www.connectionstrings.com (although, they don't mention using a System DSN, see the google search http://www.google.com/search?hl=en&lr=&q=DSN+string+settings+parameters+SQL+Server&btnG=Search for more references to DSN Strings)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Where can I find un running demo please beacause too much errors
Add Database Field: SQL.Drivers : int LookupID = (Int32)ds.Tables[0].Rows[0]["ID"]; no rows
can I hase the script for a good Test Table please
.: Ernest Bariq :.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
public string SelectStatement { get { if (this._SelectStatement == null) { //Prepare the statement string select = "select "; string idField = TextUtilities.SubOutFields(this._IDFormula, this._IDFields.Split(',')) + ", ";
this._IDFormula = null;
.: Ernest Bariq :. __________________ www.mauve-corp.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hmmm, I'm not sure what the question is, but I can tell you what the code that you mentioned is for.
from your previous post...
(Int32)ds.Tables[0].Rows[0]["ID"]
I am assuming that you attempted to create a table in the DB. The code that you have now requires that the keyfield be named ID, be set as the primary key and also have it's "identity" property set to true in SQL Server (done in the table design mode).
The code that you mentioned in this post has to do with generating the dropdown lists for forms. If you want to have a field that relates to a lookup table in the database, then there are two options:
1. Name the field that will refer to the lookip table "YourTableName_ID". In addition, "YourTableName" will have to have a field named ID (again, set as primary key, a numeric type, and it's identity set to true), as well as an "option" field that will end up being the option in the dropdown. 2. You will have to create a lookup for the field, then assign the lookup to the field. For an example of this concept, go to the _Lookups table and look over those examples (the Users_Name lookup shows a lot of how it works). Then check out the _Fields table to see how the lookup is assiged to the fields.
I know it is a little confusing at first, but I am still writing all of the documentation for the system.
Let me know if you have any other questions!
|
| Sign In·View Thread·PermaLink | 3.00/5 (1 vote) |
|
|
|
 |
|
|
Hi
I unzipped all the files attached the db set up the web share and eventually got it to read the SQL db using the configuration file. I keep on receiving allot of erros though, multiple errors on all pages. Like if I go to process I get the error "Too many rows in sysprocess with name email". Treeview page gives me erros in the left and main frame, both are sql exceptions. Left frames error "Invalid object name Categories" The main frame times out with a maximum pooled connection error. Obviusly the connections are not closing and my pool size limit is the default of 100.
Is there perhaps an proper installation instruction somewhere, or did I miss any configuration settings?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Yes, both of the links that you mention will produce those errors. Let me explain why real quick....
This is a work in progress, and some links that are in there are from when I had a different database connected to the system. The TreeView link used to demonstrate how to show inventory categorized by Manufacturer. The inventory and manufacturers tables are no longer in the database, so when the generic treeview link points to these tables in the querystring, the treeview code attempts to load up these tables accordingly. However, if you look at the help link, you will notice it is the same url as the treeview link, but simply with different tables listed as the instance and organizer tables. This link should be removed unless you actually create these tables, but I simply forgot to remove them before hand.
As for the process link, this is again a similar problem. The process that it used to show was how to email a bulk list of contacts out of tables that are no longer there.
Both of these features do indeed work, they just need some configuration and direction as to what they are going to do. For example, the treeview page can, in a treeview type of fashion, display data that is related to eachother in a parent/child type of relationship. Displaying inventory, contacts at an account, or even a help system are all examples of how to use the treeview. All you need to get this done though is to simply have two tables that relate to eachother (or itself in the case of the help system). Simply create the tables that you wish to use in SQL Server, then go to the administrative tools link and click the "Initialize System tables" link, and your tables will become available within the system. Then you can modify the treeview link to include those tables in the link. (The instance is the table whos info will appear as an instance in the right hand side, and the organizer table is the "parent" table that will organize the instances and allow for you to select specific instances after expanding the branches of the organizer.
The processes also need to be configured, although it requires a small amount of custom code to tell it what to do, and thus takes a bit more work than using the treeview framwork. A process can be adding in rows to both a parent and child table, email a list of people that a user selects, or any other number of things. The process framework is exactly that, a framework that allows you to re-use any of these components in a procedural/wizard type of setting. I am currently still documenting all of this functionality, and it will be included in the next revision of the _Help table (and thus, be accessible through the help link at top).
I apologize for not getting all of this explained up front, but I plan on having the new and improved documentation uploaded soon. For now, everyone, please feel free to ask any follow up questions to what I have mentioned here and it should make more sense.
Pretend though, that this is an "Application without a cause". I currently have a CRM system that simply changes the database to contain the tables that one would need for a CRM system. I am now in the process of documenting it for end users, as well as writing more documentation in the system that covers what I have mentioned here. It is a LOT of stuff to cover, so please be patient while I finish that up. However if you can't wait, you are free to post your questions here, or ask me direct at multiformity@austin.rr.com and I will be more than happy to explain things in greater detail. I try to answer questions within 24 hours, but it usually ends up being about 8-12 hours max.
You can also find me online on Yahoo IM under the name "dotnetdudeatx@yahoo.com", feel free to add me and ask me questions there.
I am open to all suggestions, and hey, if you write some generic code that applies to the base system as it exists now, send it to me and I will incorporate it into the code base and give you the appropriate kudos that it deserves. Again though, as it sits now, this is simply a framework that allows for you, the developer, to easilly and quickly add in new functionality to the code, with little, if any, actual coding. This code takes care of the day to day mundaine details of any web based application, and allows you to focus on "what the thing should do" rather than "Now I have to make a form to edit rows in this table..."
Thanks for your time guys, and I am looking forward to any other feedback that you have!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I could not find chm you mention. Having hard time finding where the login information is coming from. Keeps using MACHINE\ASPNET user wich is not valid.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
I have sent the CHM file in to code project, you should soon be able to find it in the source code download. Otherwise let me know if you need it and I will send it over to you.
You can find me at multiformity@austin.rr.com
As for the Machine/ASPNET, that is the user that all ASP.Net web applications run under. You have the user configured, but your SQL server does not have that user added in. Add that user into the SQL Server logins and give them admin and DBO roles. I am assuming that you are getting the following error, which I can recreate by deleting the ASPNET user in my SQL Server enterprise manager:
Line 153: if (conn == null) { Line 154: conn = new System.Data.SqlClient.SqlConnection(DSN); Line 155: conn.Open(); Line 156: conn.Disposed += new System.EventHandler(CloseConn); Line 157: }
|
| Sign In· | | | | | |