Extension C# - Forms

    - DRAFT - USE ONLY FOR TEST -

    Forms extension is a C# extension for MindTouch that allow to crete forms inside page and link them with a dedicated mysql database

    I read a lot of article about schema less database (like the friendfeed approach), infogrid and others, but at the end I have two question:

    1. What happen if Friend Feed looses a feed record?
    2. What happen if your application looses a budget record in a project management application?

    Probably two different things...

    I think that in some cases a real ACID database is the only solution so I develop a modified MySql C# application that add a form capabilities to MindTouch

    Basic Architecture

    • two dekiscript template (xsyssqledit and xsysforms) that create forms and handle logic (insert, update, view, delete - the controller)
    • C# extension (based on the MindTouch MySql extension) that implements the database interaction:
      • function take a queryid name and some parameters (map or json) and convert this to mysql variable (SET @name = ...)
      • function look in an xml file for queryid and extract the sql query
      • function extract allowed users id, groups from xml file acl section, if the security is not satisfied, the execution halt
      • function combine the mysql set  with the sql query from xml file
      • function execute the query and return the result
    • an XML file on the local filesystem with a defined structure, queryid identify a query section that as an sql section (the real query) and an access control list with allowed users id and/or group id that can execute the query

    The idea is to allow anyone to execute query granting the security. This architecture keeps the query on a local file and pass only parameters and variable from the dekiscript and front end so users can't add sql code or query (only the administrators can do this accessing the xml file)

    Basic steps to add a form

    • add forms extension to mind touch
    • add xsyssqledit and xsysforms template to mindtouch
    • create a template that render the forms (it call xsyssqledit with a long series of parameters, see xsyssqledit for docs)
    • create a custom mysql table
    • write the basic mysql query for insert-update, delete, select and save them in the xml file

     

    Note

    Note: this solution support a many-to-many relationship, so in a forms you can automatically create/update data of other tables

    Note 2: yes, this solution require a good knowledge of mysql, but doesn't require a knowledge of C# becouse every configuration is in the xml file and dekiscript template

    I prefer to have a light, strong, fast solution that required some Sql knowledge instead having a thousand lines of code for a control panel that will make the application big and hard to modify. 

    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by