Application Factory

Labels
AJAX(112) App Studio(9) Apple(1) Application Builder(245) Application Factory(207) ASP.NET(95) ASP.NET 3.5(45) ASP.NET Code Generator(72) ASP.NET Membership(28) Azure(18) Barcode(2) Barcodes(3) BLOB(18) Business Rules(1) Business Rules/Logic(140) BYOD(13) Caching(2) Calendar(5) Charts(29) Cloud(14) Cloud On Time(2) Cloud On Time for Windows 7(2) Code Generator(54) Collaboration(11) command line(1) Conflict Detection(1) Content Management System(12) COT Tools for Excel(26) CRUD(1) Custom Actions(1) Data Aquarium Framework(122) Data Sheet(9) Data Sources(22) Database Lookups(50) Deployment(22) Designer(178) Device(1) DotNetNuke(12) EASE(20) Email(6) Features(101) Firebird(1) Form Builder(14) Globalization and Localization(6) How To(1) Hypermedia(2) Inline Editing(1) Installation(5) JavaScript(20) Kiosk(1) Low Code(3) Mac(1) Many-To-Many(4) Maps(6) Master/Detail(36) Microservices(4) Mobile(63) Mode Builder(3) Model Builder(3) MySQL(10) Native Apps(5) News(18) OAuth(9) OAuth Scopes(1) OAuth2(13) Offline(20) Offline Apps(4) Offline Sync(5) Oracle(11) PKCE(2) Postgre SQL(1) PostgreSQL(2) PWA(2) QR codes(2) Rapid Application Development(5) Reading Pane(2) Release Notes(184) Reports(48) REST(29) RESTful(29) RESTful Workshop(15) RFID tags(1) SaaS(7) Security(81) SharePoint(12) SPA(6) SQL Anywhere(3) SQL Server(26) SSO(1) Stored Procedure(4) Teamwork(15) Tips and Tricks(87) Tools for Excel(3) Touch UI(93) Transactions(5) Tutorials(183) Universal Windows Platform(3) User Interface(338) Video Tutorial(37) Web 2.0(100) Web App Generator(101) Web Application Generator(607) Web Form Builder(40) Web.Config(9) Workflow(28)
Archive
Blog
Application Factory
Saturday, April 21, 2012PrintSubscribe
Complex Action Confirmations

Application business requirements may specify actions demanding user-defined values. Field values of a selected data record are not sufficient to complete such actions.

Consider the example of implementing a custom business logic with “SQL” action. The example explains how to create a Standard Discount action that can be executed on any order in the Northwind sample application. The action will increment the discount of line items of a selected order by 1%.

The screen shot shows the application in action.

A custom action in the group with 'Grid' scope in a web app created with Code On Time application generator

The properties of the action are defined as follows.

Property Value
Command Name SQL
Header Text Standard Discount
Data
update "Order Details"
set Discount = 0
where 
    OrderID = @OrderID and Discount = 0.1
    
update "Order Details"
set Discount = cast(Discount as decimal(3,2)) + 0.01
where 
    OrderID = @OrderID and Discount < 0.1
Confirmation The discount will be increased by 1%.

If the action is selected then a simple confirmation is displayed.

A simple action confirmation in a web app created with Code On Time

A more flexible implementation of this action would allow a user to enter the exact discount that will apply to order line items. Let’s implement a confirmation that will allow capturing the discount and have it passed to the action implementation.

Start the application generator and click on the project name, click Design to activate the Project Designer. Select the Controllers tab in Designer and choose New | New  Controller option on the action bar.

Creating a new data controller in a Code On Time web application

Enter the following property values and click OK button.

Property Value
Name DiscountDialog

Right-click the DiscountDialog / Fields node on the Controllers tab in Project Explorer and select the New Field option.

Adding a new field to a data controller

Enter the following property values and click OK button to save the new field.

Property Value
Name Discount
Type Double
Code Default 0.01
Label Discount
Data Format String p

Our “confirmation” data controller is ready.

Select Orders / Actions / ag1 (Grid) / a100 – SQL | Standard Discount action node on the Controllers tab in Project Explorer.

Action with command name 'SQL' selected in Project Explorer

Change the action properties and click OK button.

Property New Value
Header Text Apply Discount
Data
update "Order Details"
set Discount = @Parameters_Discount
where 
    OrderID = @OrderID
Confirmation

_controller=DiscountDialog
_title=Apply Discount to Order Details
_width=500

Click Browse on the Project Designer toolbar to have the application generated. The home page of the app will open in the default web browser. Navigate to the Orders page and select Apply Discount option in the context menu of an order.

The modal form view will display. Enter a discount and click OK button to execute the action.

 A modal confirmation of 'SQL' action in a web app created with Code On Time web application generator

Any field values entered in the modal action parameter form are accessible in the “SQL” action script if your prefix the field name with “Parameters_”. Our script is referencing the entered Discount as @Parameters_Discout parameter.

If you are writing a custom business rules class or implementing shared business rules then you can reference the action parameter field by name “Parameters_Discount” as you would use any other field of a data controller.

The application client library displays a modal view if you define the confirmation property of the action as a collection of name/value arguments.

The library supports the following arguments. Only the “_controller” attribute is mandatory.

Argument Description
_controller The name of the data controller.
_view The ID of the view that must be activated in the modal popup. If left blank, then the first view of the data controller is activated. Optional.
_commandName The name of the start command. If left blank, then New command is the start command. Optional.
_commandArgument The optional argument of the start command.
_title The title of the action confirmation modal popup. If left blank, then the view label is displayed instead. Optional.
_width The width of the action confirmation modal popup. If left blank, then the default width of 800 is used. If the specified value exceeds 80% of the browser window width, then the popup width will be reduced to that value. Optional

The DiscountDialog controller defines a single field. There are no commands, views, or actions.

A data controller must define one or more fields to be used as an 'action confirmation'

The application framework treats data controllers that do not have a command as virtual controllers. Virtual Data Controllers are not based on a database table or view. The assumption is made that the controller has one data row only.

If the controller does not define its own views or actions then the application framework will complete the controller definition at runtime. This configuration is equivalent to the custom-defined controller shown in the picture.

A minimal 'action confirmation' data controller with custom views and actions

The virtual data controller used for action confirmation is not different from any other data controller based on a real database table or view. You can implement business rules and custom actions that may in turn require other virtual controllers for confirmation.

Developers can apply data controller virtualization techniques to customize the data controller actions at runtime according to the custom workflow requirements. For example, the action properties Data and Confirmation may be stored in a dedicated database table and applied to data controllers based on user identity.

Saturday, April 21, 2012PrintSubscribe
Confirming User Actions

Various user interface actions may lead to a serious impact on application data and require additional visual confirmation. The standard action Delete is a good example. End users are presented with the standard browser window to confirm the action.

Standard simple confirmation is displayed when a user initiates 'Delete' action in a Code On Time web application

Application client library automatically assigns the standard “Delete?” confirmation message to a Delete action if the explicit confirmation is not defined in the data controller.

You can set a confirmation message for any action in Project Designer.

Create the Northwind sample, activate the project design mode and select Suppliers / Actions / ag1 (Grid) /a3 node on the Controllers tab in the Project Explorer.

Actions  'ag1/a3', 'ag2/a2', and 'ag4/a2' have their 'Command Name' property set to 'Delete'

Change the properties of the action as follows and click OK button.

Property New Value
Confirmation Delete “{CompanyName}” supplier?

Notice that there are several other ways to delete a record. If you want to displays the exact same confirmation message, then make sure to change the Confirmation property of actions Suppliers / Actions / ag2 (Form) / a3 and Suppliers / Actions / ag4 (ActionBar) – Edit/Delete / a2.

If an action with confirmation is activated, then the client library will parse the content of the confirmation message and replace any matching field names enclosed in curly brackets with the values from the  current data row.

The new confirmation message is displayed if you generated the application and try deleting a supplier.

A customized simple confirmation message in a Code On Time web application

A developer can assign a consistent message to all actions with the command name Delete by implementing a data controller virtualization.

Friday, March 30, 2012PrintSubscribe
What is Windows Azure Platform?

Azure Factory allows rapid development of web applications for Microsoft Windows Azure cloud. In minutes you can create cross-browser web applications that look similar to the one in the picture.

Sample Azure Factory application created with Code On Time

Curious what Windows Azure is? Read on or take a look at the Azure Factory tutorial explaining how to create an Azure Factory project and deploy it to the cloud with Code On Time web application generator.

What is Windows Azure Platform?

Windows Azure Platform is a cloud hosting service run by Microsoft that enables you to store data, as well as build and connect apps. Everything is stored in a Microsoft data center - the only thing you have to manage is your application. The applications are hosted on cloud operating systems called Windows Azure. This operating system serves as a runtime for your application. While it can't be accessed directly, it can be interacted with using the Azure Portal. You can create, edit, and delete hosted services, and storage accounts. Rich SQL Azure reporting capabilities are also present.

What is the Windows Azure Platform?

Typical "On-Premise" Application Setup

The usual application setup in your own on-premise data center will include the following items:

  • Firewall
  • Load balancer
  • Application server
  • Database server
  • Other services (access control, security)

This setup will take an exhaustive amount of time and money to implement, and that's just the hardware side. You will also need to install the operating systems and configure them to work together. And how long will this system run until you have to start updating, patching, and fixing everything? When traffic increases, you'll also have to scale this system. Windows Azure offers a better solution.

Typical 'On-Premise' Application Setup

Using Windows Azure

Switch your application to Windows Azure - all the hardware is stored in a Microsoft data center, and there is no need to manage the operating system. All you have to do is deploy your application to the cloud, and everything will take care of itself. This allows you to focus on adding business value and key features to your applications.

With Azure Factory, your job becomes even easier. Point to your database and press Generate. In a few minutes, you will have a full featured web application that is sure to impress peers and customers. Then, press Publish, and you will have everything you need to deploy to Windows Azure.

Using Windows Azure

SQL Azure

Windows Azure allows you to store and run your application in the cloud. SQL Azure will store the the data for your application. It is a relational database using SQL technology, that runs in the Azure cloud. Use the online Database Manager provided by Microsoft, or connect to the database with SQL Server Management Studio 2008 R2. SQL Azure also supports T-SQL.

The database is highly scalable - availability will increase with demand, and price will be dictated by usage. All data is distributed across many nodes, with at least three copies, to insure fault tolerance. If one copy goes down, another copy is automatically activated to insure a seamless experience.

SQL Azure

Continue to Azure Factory