db-driven / programmatic validation asp.net mvc? - asp.net-mvc

I want to create a system where users can create forms through a UI, and the list of fields gets stored in in the database. The user can then choose validations for the form, and those get stored in the datbase too. When a user visits the form, the correct fields are displayed, and when they submit the form the correct validations are pulled from the db and run against the submitted data. Is there already any kind of system that does this (ideally open source).
I know there are form and survey services out there but I don't want a SaaS solution because I need to be able to customize most aspects (front end, server side, and db).

Type "open source survey software" into a search engine, and you'll find LimeSurvey, an active project with a viable survey system that you can manage and customize on your own server. It supports a number of common SQL implementations.
It's not aligned with the specific language & environment tags in your question, but otherwise seems a fit.

Related

Dynamic Form Builder in Asp.Net MVC

In our current application there is a new requirement of our client.As they told that they need n numbers of forms at different stages of their business and those are changing time to time. Even a new forms can be added.
Their requirement is once the product is delivered to them they will not come back to us again and again for each change and will create those form by their own.
Simply they want a user interface where they can create the form by drag and drop manner.
What they want :
In our application there will be a form building section where a non technical person can be able to create a form.
Mapping the controls with existing data of their existing database so that the form is populated with the corresponding data ( data will be inserted into the database using another user interface).
Once the data is populated they will take the print out of the filled up form and will proceed as per their business flow.
As they introduce new form time to time we can't provide any predefined template to them and they are not agree to design the form in HTML.
Is there any way of doing this in Asp.Net MVC (without using any CMS ).

Is it possible to enable the standard Orbeon submit button in the example applications

Orbeon is providing some examples that can be run easily. For example I can run in my computer http://localhost:8080/orbeon/xforms-wizard-pfc/ that does not seems to be a form created using the Form Builder. I was always using the form builder as a starting point but the last days I was paying more attention on these examples for learning a little more.
In this case, it is a form that is using a flow with different questions that are defined in different XHTML files. I like this idea for using it in very big forms.
All this examples, are using custom submit buttons with its own actions, but none of them are saving the result into database except an example that uses a rest service of 'exists' database (I have configured my Orbeon datasource to use MySQL).
I have tested that some configuration of the form runner (properties-local.xml) affects also these examples such as changing the date format, therefore maybe it is also possible to enable the standard submit button that already I have configured and save the forms into database for later be shown in the summary page of the Form Runner. But I am not able to do this with these examples using the property oxf.fr.detail.send.success.uri.<app>.<form>. Specially, because no application is defined in the example.
There is any way to, for example, save the submitted data of these "XForms applications" using the datasource of Orbeon to save to MySQL database as when using a form created by the Form Builder?
Or I need to use rest services to send data to a custom application that does all this kind of work?
The example you're referring to (xforms-wizard-pfc), along with similar examples, are written in "plain XForms". In the other side, when you create a form in Form Builder, the result goes through Form Builder, that adds a number of features on top of XForms, like persistence or the error summary (with a number of them implemented, at least in part, in XForms).
All those features that are part of Form Runner are not designed to be used on their own, so you can't easily, say, "just use the Form Runner persistence" in one of your forms. This means that you most likely need to decide whether you're better off using the whole of Form Runner, or no Form Runner at all, and just write plain XForms.

Using a client state model object for a hierarchical MVC web application

I'm building a large hierarchical web application and I need some help deciding on some best practices with leveraging MVC.
The application will have tabs at the top which control a sub page, and a query pane (off to the side).
There will be two templates for query panes, each used by different sub-pages. The sub-pages will be based on the selected tab with settings derived from the query panes.
Clicking on tabs or updating the query pane will update the sub-page section without refreshing the page.
I'm a bit new to MVC and what I don't quite understand is how I can leverage MVC methodologies to help me manage the web application's state (which consists of the selected tab, query options, and other page-specific options).
Currently I'm planning on initially setting up a model which stores the client state parameters (default values, or values obtained from a DB), and using it to load the page, consisting of several partial views. When anything is changed (tab/query/etc), the view will call a corresponding controller, passing back model parameters via post (I'm assuming there's no way to store session-specific client state models on the server-side?).
My question is:
Am I doing it right?
If not, what am I missing; and specifically, is there a way to store these session-specific state models server side so they don't have to be passed back to the server during every single page transaction?
If I understood everything you need Its a SPA (Single Page Application). This will provide a magic user experience, without full page reload, and low data traffic. But, requireds some MVVM framework (AngularJS, KnockoutJs, etc) and a lot of JavaScript coding. But the result is amazing. The guy behind this in MVC is John Papa, take a look in everything on his blog and you will win.
John Papa Blog
Hopes Its Help you

jQuery Mobile & JS Frameworks

At my work we have an existing ASP.NET web application and are duplicating some of the pages & functionality to better target our mobile users. We are using the jQuery Mobile framework and ASP.NET Web Forms to do this.
Since this is going to target the mobile web I would like it to be fast & lightweight which means turning off the view state, loading lists on demand (when opened), and I'd like to eliminate post backs (annoying & doesn't work well w/ jQuery Mobile). Of course this means doing a lot more work client side.
One of the pages is a bit complex, it allows the user to log items, however it's layout is fully customizable. Prior to logging the user is able to define what fields they wish to track. Some of these fields are system designated but others are created by the user. They can choose from a checkbox, dropdown list, date box, radio button, text box, or list box. Some fields are also tied to other fields meaning the user can select an item in one drop down list which then reloads another drop down list with the associated data. The user also has the ability to add an unlimited amount of additional fields (drop down lists) while on the actual page used to log their item. Once the page is filled out by the user the selected fields values are saved back to the server in a database table.
I figured this would be a great chance to use a JS Framework like Knockout.js, the dependency tracking would come in great for trying to keep things synced up & reload lists as needed based on selections made in other lists. Even though I am a bit concerned about how it would handle the fact that the form layout is dynamic & can be modified once displayed (anyone know if it can handle this?).
So I started looking around for jQuery Mobile & Knockout.js and apparently there are issues, workarounds, limitations, etc. w/ the two working together and I saw the same thing w/ Backbone.js
Does anyone have any suggestions w/ this? Is it worth the hassle to try and use a JS Framework of some sort w/ jQuery Mobile? Can a JS Framework handle the form I am trying to create w/o me having to jump through hoops? Am I better off looking for some sort of dependency tracking plugin and just using that and if so can you suggest any that will wire up to my model object & other controls on the page & work correctly w/ jQuery Mobile?
Overall, knockout should be a good fit for your requirements. I'm currently using it an MVC3 applicaiton to do similar things to what you are describing.
As for your complex page, this is all doable.
Your highly customizable form. This is one area where knockout really shines. It allows a separation be how data is displayed and the data itself. This can be done with different data-bindings types and you can add your own customized bindings. I actually do this a lot when creating a form and experimenting with what the test control type is.
Dynamic Layout - With Knockout there is no direct connection between the DOM and the data. Knockout's data-bind statements allow you to connect new content to it's data at run time. This currently works well in my current app.
For your requirement about unlimited adds, take a look at the Contacts Editor Demo. It seems to have features to do the unlimited requirements
In general with knockout, once I went to using ajax to handle all my data requirements, things became greatly simplified.
As far as using knockout with jQuery mobile, knockout is now part of the new releases of Asp.Net Mvc4, developer preview. It is my understanding that knockout is key to MVC's design on building single page web offline where the data is stored locally, then dynamically added to the displayed page. Cannot find link right know, but I'll keep looking and post edit later.
Hope this helps out. Also, checkout the links on knockoutjs.net home page. -

Generate dynamic list from external database

I'm very new to Sharepoint and I am just wondering if it's possible to somehow use data from an external database as a List that users can select from within a form. How much extra development does this involve?
Essentially we have a different (non sharepoint) site that allows us to set up projects. Once a project is set up I would like the project code to be usable from within workflows, forms, etc.
If you have MOSS Enterprise, you may want to take a look at the Business Data Catalog (BDC). It allows you to bring external data to SharePoint. Supported inputs are either a database or a webservice.
http://msdn.microsoft.com/en-us/library/ms563661(office.12).aspx
After you have set up the BDC, you can use the business data field to use that external data as metadata. That way, you can make decisions in workflows based on that metadata. If you want to play with the BDC, get yourself a decent tool to generate the application definition files (xml), because creating them manually is cumbersome.
Consuming external data in forms is even easier. It doesn't require the BDC as you can use databases and webservices directly as a secondary datasource in InfoPath.
Another option (if you don't have MOSS Enterprise) is to create a timerjob that keeps a list up-to-date based on the projects found. Of course, this is not updated in realtime and requires some programming.

Resources