Monday, March 23, 2015PrintSubscribe
Charts, Drag & Drop Upload, Signature Capturing, Integrated Content Management System, Workflow Register, Single Page Applications, Dynamic Access Control List

Code On Time release includes a monumental collection of enhancements and features.

The release highlights are presented below. Detailed tutorials dedicated to individual features will be published over this week. The roadmap for 2015/2016 with detailed release notes will also become available this week. We are looking forward to your input.

“Charts” View Style for Touch UI

Touch UI applications now supports a new presentation view style called “Charts”. The feature works automatically and can be configured at design time. Here is a sample of charts created for Orders data controller in the Northwind sample.


Learn about Charts view style now!

“List” View Style for Touch UI

We have reworked “Cards” and “List” view styles for Touch UI. Touch-enabled devices will default to “List” view, while the “Grid” view is the default option for desktop users. The new “List” view style displays items of uneven height with every single field presented to the users. Text of field values will wrap to the next line.


View style “Cards” offers multi-column presentation of items. All items have the same height.  The text of “long” values does not wrap. Only a subset of fields may be visible within a card.


Grid view style offers the most compact presentation of data.


“Charts” view style provides an insight into the current data set.


Drag & Drop File Upload

Drag & Drop file upload is now supported in both Desktop and Touch UI. File upload preview is also integrated.

First, the user taps or clicks on the drop box to show the file upload prompt. The user may also drag the files into the drop area directly from the file system.


A preview of the files is displayed directly in the form prior to upload.


The drop box provides visual feedback when files are dragged over.


Progress indicator is displayed at the top of the drop box while the files are being sent to the server.

The relevant FileName, DataContentType, and Length data fields will updated when the user drags or drops the file.

End users can capture images directly from camera or mobile operating system on touch-enabled devices.

Signature Capturing

If you have a binary field in a table then you can configure the field to capture signatures for Touch and Desktop UI. Just set On Demand Display Style to “Signature” to have it activated.


End users can use touch gestures or pointer devices to draw a signature. The signature is uploaded as PNG file with white background directly to the database.

Single Page Applications

A new single-page application implementation based on HTML is now supported for Azure Factory, Mobile Factory, Web App Factory, and Web Site Factory projects.

Create a new project with default settings to see it in action. There are no *.aspx files in the project, just the HTML files. Here is the sample markup of the Customers page in the sample Northwind web app.

<!DOCTYPE html >
<html xmlns="">
    <meta name="description" content="This page allows customers management." />
    <div data-flow="row">
      <div id="view1" data-controller="Customers" data-view="grid1" 
data-show-in-summary="true"></div> </div> <div data-flow="row"> <div data-activator="Tab|Orders"> <div id="view2" data-controller="Orders" data-view="grid1" data-filter-source="view1"
data-filter-fields="CustomerID" data-page-size="5" data-auto-hide="container"
data-show-modal-forms="true"> </div> </div> <div data-activator="Tab|Customer Demo"> <div id="view3" data-controller="CustomerCustomerDemo" data-view="grid1"
data-filter-source="view1" data-filter-fields="CustomerID" data-page-size="5"
data-auto-hide="container" data-show-modal-forms="true"> </div> </div> <div data-activator="Tab|Order Details"> <div id="view4" data-controller="OrderDetails" data-view="grid1"
data-filter-fields="OrderCustomerID" data-page-size="5" data-auto-hide="container"
data-show-modal-forms="true"> </div> </div> </div> </body> </html>

Integrated Content Management System

Applications generated with SPA page implementation can include an integrated content management system that turns your app in a highly customizable solution. Just create the table called SiteContent  shown below and have it included in your project (SITE_CONTENT and site_content variations are also supported).

CREATE TABLE [dbo].[SiteContent](
    [SiteContentID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
    [FileName] [nvarchar](100) NOT NULL,
    [Path] [nvarchar](100) NULL,
    [ContentType] [nvarchar](150) NOT NULL,
    [Length] [int] NULL,
    [Data] [image] NULL,
    [Text] [ntext] NULL,
    [Roles] [nvarchar](50) NULL,
    [Users] [nvarchar](50) NULL

Generate your app, navigate to ~/pages/site-content and upload images, html pages, data controllers, or any other content. Specify the path to the files and they will become available to the authorized users. Hook up content to your static navigation system with the help of dynamic sitemaps.

The sitemap sys/sitemaps/employee-directory will merge with the default sitemap to create new navigation options in the default app.

+ Home

++ One More Level

+++Employee Directory
description: Directory of company employees.


Create a sitemap with the name sys/sitemaps/main to replace the default navigation system of your app.

Integrated CMS is supported in both Desktop and Touch UI.


Dynamic Access Control List

Premium and Unlimited edition users can take advantage of Dynamic Access Control List. Create access rules in the integrated CMS with the path sys/dacl. Application framework will locate files stored in the CMS and apply rules to all matching SELECT statements composed at runtime. You can also store access control rules as text files in the ~/dacl folder of your application.

This sample set of rules will affect all data controllers of the Northwind sample that have CustomerID field in the views.

Field: CustomerID
Roles: Users
Role-Exceptions: Administrators
[CustomerID] in ('ANTON', 'ANATR')
Field:       CustomerID
Controller:  Customers
Users:       user
[Country]='USA' and [ContactTitle]='Owner'
Field:       CustomerID
Role-Exceptions: Administrators
select CustomerID from Customers
where Country='UK' and City='London'

The picture below shows the effect of the rules on the Customers data controller.


Learn more about access control rules that can be written in code.

Dynamic Controller Customization

Integrated CMS can also store customizations of data controllers.

For example, file sys/controllers/hr/Employees.Alter.Directory will turn Employees data controller in a phone directory when defined as follows:


select-views("editForm1", "createForm1").delete();


    .select-data-fields("LastName", "FirstName", "Extension", "HomePhone", "Photo")

select-actions("CHANGE", "Select", "EXPORT")

This is how the new phone directory will look.


It is not possible to edit any data on this page. Only a small subset of actions is visible.


Workflow Register

Workflow Register uses the integrated content management system to define workflows as a collection of resources. For example, the workflow sys/workflows/hr can be defined as the following collection.


It provides access to page hr/directory, activates a customization for controller Employees, and adds employee-directory sitemap to the application sitemap.

The workflow can be assigned to anonymous users by creating the entry “sys/register/roles/?” with the text “hr”  in the site content.

Consolidated Client Library Files

The script library has been consolidated. The scripts have been renamed.

  • daf.js <- Web.DataView.js
  • daf-resources.js <- Web.DataViewResources.js + Web.MembershipResources.js
  • daf-membership.js <- Web.Membership.js + Web.MemershipManager.js
  • daf-menu.js <- Web.Menu.js
  • daf-extensions.js <- Web.DatViewExtensions.js
  • touch.js <- Web.Mobile.js

Pages Can Be Generated “First Time Only”

Pages of the project can be based on templates and be configured to generate “First Time Only” similar to user controls.



Wednesday, June 19, 2013PrintSubscribe
ASP.NET 4.5, DotNetNuke 7, Upload on Insert, CKEditor, Dynamic Wait Indicators, Azure SDK 2.0, Native CSV Import, Container “page”

Code On Time release includes major enhancements  providing the foundation for the upcoming Mobile Client Library and 2nd generation datasheet view. Both will be included in the follow-up release in July of 2013.

ASP.NET 4.5 has been available for awhile. We now offer support for the newest .NET Framework in  Web Site Factory, Web App Factory, and Azure Factory projects.

Starting with this release any new apps configured to use ASP.NET 4.5 (default option) will be created without dependency on Ajax Control Toolkit DLLs. We will be phasing out the toolkit by replacing any dependencies with jQuery equivalents. Existing projects that do use components of ACT will continue to be generated with the binary libraries.

Master page, theme, and script references where enhanced to further reduce application footprint and speed up page loading. Mobile client library requires this enhancement.

DotNetNuke 7 is now supported in DotNetNuke Factory. Create ASP.NET 4.0 line-of-business web apps as modules for the latest version of the populate open-source content management system. New theme Gravity is included to provide a matching look-and-feel for the apps packaged as DNN modules.

Upload on Insert is a frequently requested feature that was previously absent in the application framework. Binary content is uploaded independently from the data fields of a new record. This creates a unique challenge to delay uploading until a record has been successfully persisted. The new client library does just that. New projects will automatically include BLOB fields in createForm1 to allow upload on insert. Just make sure that the binary columns are not marked as required in the database. Drag binary fields to the createForm1 view to enable this capability in existing apps.

CKEditor is a popular web-based rich text editor embedded in many online products. We are offering a simple integration of this editor in any project created with the new release of the app generator. The built-in rich text editor is now implemented without server-side support and works entirely on the client, which makes it lightning-fast.

Dynamic Wait Indicators are now  a permanent feature of the client library. If a server-side operation takes longer than 3/4 of a second to complete, then a thin marquee line will be displayed at the top of the data view. Modal views will display a wait indicator at the top of a page. This applies to data paging/sorting/search, action execution, reporting, import, upload, and download. Consistent integration of dynamic wait indicators improves usability by offering intelligent visual clues about long running requests. Navigate to our demo web site and try printing a list of customers to see the wait indicator in action.

Azure SDK 2.0 is now supported in Azure Factory projects.

Native CSV Import classes are  implemented in web apps created with Premium or Unlimited edition. The new importer is built into the application framework, which eliminates the need for Microsoft Access Database Engine installation on the server. “Import” action is now also included under Actions menu of data views in Azure Factory web apps. Import dialog simplifies mapping of fields by hiding “mapped” fields from available mapping options.

Container “page” allows defining user controls that will be displayed in page header, title, sidebar, or footer.

The following enhancements, bug fixes, and features are included in this release:

  • ASP.NET 4.5 is now supported in Web App Factory, Web Site Factory, and Azure Factory projects.
  • Application Framework now includes a native CSV parser based on the work of Sébastien Lorion. Both SharePoint Factory and Azure Factory projects are now supporting the “Import” action with native CSV parsing.
  • Web Site Factory solution files are now located under [Documents]\Code OnTime\Solutions\Web Site Factory\PROJECT_NAME folder. The new solution file will be created if a website factory project is regenerated. If you are using a source control system then make sure to change the project bindings accordingly.
  • Theme file is referenced with the app generator version number in the page header.
  • Azure SDK 2.0 is now supported in Azure Factory.
  • Ajax Control Tookit 7.0429 is now integrated in the apps based on ASP.NET 3.5 and 4.0.
    Upgrade instructions for ASP.NET 4.0 projects:
    • Make sure to delete file ~/App_Code/Controls/RichEditor.* from the source code of your Web Site Factory project.
    • Delete the files MyCompany\Controls\RichEdit.* from other project types where MyCompany must be replaced with the Namespace of your project.
    • Select the project on the start page of the app generator and choose Refresh, do not select any controllers and click Refresh.
    • Re-generate the app.
  • Custom *.rdlc reports are now published with Web Site Factory projects.
  • CKEditor is seamlessly integrated in web apps created with Code On Time.
  • Removed references to "stub" images from the master page.
  • Main master page is not using “cellpadding”, “cellspacing” and “valign” attributes. It relies on new CSS rules instead.
  • Built in Rich Text editor and CKEDITOR will take at least as much space as specified by the CSS class "dataview-rich-text". Define a custom CSS rule with “width” and “height” property to set up a non-standard size for rich text editors.
  • Application pages include “lang” and “xml:lang” attributes in “html” tag when loaded in a browser.
  • Application framework stylesheet Core.css incorporates the core styles from AjaxControlToolkit to handle calendar, tab container, color picker, and HTML editor to minimize the number of CSS links in application pages.
  • Thanks to Giampaolo Bulleri for contributing Italian localization.
  • Membership component of the client library explicitly sets up the path to Authentication_JSON_AppService.axd of a web app when initialized.
  • App generator will place controls with IDs 'header', 'title', 'sidebar', and 'footer' into appropriate regions of a page if the controls belong to a page container 'page'.
  • Enter NoSeeAlso class in "Custom Styles" property of a page to hide the corresponding area created automatically by the class library.
  • The "Reset" button on automatic search bar has been replaced with "Clear" button. The new button will simply remove all filters.
  • BLOB fields can now be added to the "createForm1" or any other view that offers Insert command. BLOB uploading is deferred until the primary key is returned after a successful insert operation.
  • New projects will automatically include BLOB fields in 'createForm1'. Developers can add BLOB fields to existing data controller views 'createForm1' manually.
  • CSS class "dataview-loading" is added to a data view container when a data view makes a first call to fetch data. Class "dataview-loaded" will replace "dataview-loading" after the first call has been completed.
  • Client library will open a new window when the original of a BLOB field is downloaded by user. The data view will display a marquee indicating the download progress. The new window is twice smaller than the main browser window.
  • Server-side business rules (Code and SQL) do not interfere with Blob Adpaters updating utility fields.
  • Data fields with text mode set to "Static" work correctly in grid view when inline editin of row values is performed by a user.
  • Application framework includes FileSystemBlobAdapterBase class to allow override of file system blob adapter property IsPublic.
  • "Soft" date filters created with SQL business rules will correctly filter the data.
  • Import automatically adjust the list of the available unmapped fields to ease selection of mappings.
  • Main and Help master pages are using a short form of DOCTYPE declaration.
  • Methods AccessKey, SecretAccessKey and property Bucket of S3BlobAdapter are now virtual
Sunday, May 5, 2013PrintSubscribe
Assigning Access Key With Code

Both Azure Storage and Amazon S3 require a couple of security parameters and repository name in order to upload or download a file. The data controller configurations of both adapters require explicit definition of these parameters.

Let’s consider the configuration of an Azure Blob Adapter.

Field: Picture
Storage-System: Azure
Account: northwindproductpictures
Container: pics
Key: e2Wl668b6fEGauS6cOTAHaj7Ut6QfwKdbGY4Vd8yngz40y2f54M5EfZtSNNHYoXW7i7+kZAfFJrg==
Path-Template: Products/{ProductID}-{PictureFileName}

The application framework allows providing default values for Account, Container, and Key.

Start the app generator. Select your project and click Develop. The project will be opened in Visual Studio. In the Solution Explorer, right-click on ~\App_Code\Data, and press Add | Add New Item…

Adding a new item to the Data folder in a Code On Time Web Site Factory project.

Select Class from the list, specify a name, and press OK to add the new file.

Adding a class file to the project.

Replace the code base with the following. Use your own key instead of the highlighted text.


using System;

namespace MyCompany.Data
    public partial class AzureBlobAdapter
        public override string Key
                return "ENTER KEY HERE";

Visual Basic:

Imports Microsoft.VisualBasic

Namespace MyCompany.Data
    Partial Public Class AzureBlobAdapter
        Public Overrides Property Key As String
                Return "ENTER KEY HERE"
            End Get
            Set(value As String)
                MyBase.Key = value
            End Set
        End Property
    End Class
End Namespace
Save the file, and activate the Project Designer. In the Project Explorer, switch to the Controllers tab and double-click on Products. Change the Blob Adapter Configuration as shown below.

Field: Picture
Storage-System: Azure
Account: northwindproductpictures
Container: pics
Path-Template: Products/{ProductID}-{PictureFileName}

The application framework will now use the key explicitly returned by the AzureBlobAdapter.Key property. 
The image thumbnails are loaded from Azure Storage using the new key.

The Account and Container properties may also be overridden in a similar fashion to further simplify the adapter configuration. Multiple virtual binary fields may share the same Account, Container, and Key. The implementation of the properties may optionally read values from the database depending on the user identity, role, or other conditions.

The Amazon S3 Adapter allows overriding properties AccessKeyID, SecretAccessKey, and Bucket.