Blog

Labels
AJAX(112) App Studio(7) 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(177) 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(183) 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(2) 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
Monday, May 27, 2019PrintSubscribe
Code On Time With Command Line
Code On Time release 8.7.11.0 makes possible creating mobile and web apps directly from command line. New command line parameters allow configuring, generating, and refreshing apps without requiring developer to go through Project Wizard and Model Builder. Now the app generator can be integrated in automated scripts to produce custom apps.



For example, the following command line will instantly produce a basic app:

codeontime -generate "c:\apps\app1" -theme "Citrus" -run -appname "Hello World"

The app will be displayed in the default web browser when the code generation is completed.


This application is not connected to a database and displays no data. Next command will connect it to a database and produce data models, data controllers, and pages for Products, Suppliers, and Categories. The app will have a built-in membership manager and content management system.

codeontime -generate "c:\apps\app1" -dbconnection "Data Source=;Initial Catalog=northwind-cmd;Integrated Security=True;" -objects products,suppliers,categories -dbmembership -dbcms



This command will remove CMS (Content Management System), enable reporting, change the theme to "Petal", and make the app display Shippers and Customers tables.

codeontime -generate c:\apps\app1 -dbcms false -reports -theme Petal -objects Shippers,Customers


Notice that previously specified project options are persisted in the project file and do not need to be re-entered. Use double quotes to surround property values with spaces. Value "true" for Boolean properties can be omitted.

The app generator folder is not included in the Path variable of the machine during installation. Make sure to add C:\Program Files (x86)\Code OnTime LLC\Code OnTime Generator path to the Path environment variable. Otherwise use a full path to the app generator executable codeontime.exe when using the app generator in command line mode.

The three core commands controlling the app generator from command line require a path to the project folder. If the specified folder does not exist, then it will be created. If there is no file DataAquarium.Project.xml in the specified location, then the file will be created with the default settings. All three commands will change the project file if the configuration options are also specified in the command line. 

-Config

Use -config command to create a project, change its options, or view the current option values. For example, this command will create a project configured for Microsoft SQL Server database, implemented in Visual Basic with MyBiz namepace, and build-in user and role management.

codeontime -Config "c:\apps\myapp1" -DbConnection "Data Source=;Initial Catalog=northwind-cmd;Integrated Security=True;" -Language VisualBasic -Namespace MyApp1 -DbMembership

This command will alter the project to have it presented in Berry theme. The app will start in a default web browser after the code generation.

codeontime -Config "c:\apps\myapp1" -Run -Theme Berry

The summary of the project configuration is display after successful -config command.




There will be a single file in the project folder.




-Generate 

Use -generate command to produce application source code. The app will be displayed in default web browser if -run option is specified for the project.

codeontime -generate "c:\apps\myapp1" 

Here is an example of application generated for the previously configured project. It includes every database object from the northwind database.




The project will look like this:



Please note that you can build this app with a single -generate command if you specify the same set of options in the command line. Command -generate first creates a project file or modifies the file according to the specified options. Code generation is performed only if every single configuration option has been successfully processed.

You can customize the generated app in the Project Wizard and Project Designer if you start the app generator without command line parameters and choose "Add an existing application" option. The new application will be displayed on start page.

-Refresh

Command -refresh deletes cached database metadata (information about tables, views, columns, etc) and rebuilds all data models, data controller, and corresponding pages from scratch. Use this command to generate the app if database schema has changed. 

It behaves just as -generate command in every other aspect.

-DbProvider

App generators supports many database engines. Option -DbProvider allows specifying the data provider for the app. By default, the assumption is that Microsoft SQL Server is the database engine of application. The equivalent command line option would be:

-dbprovider sqlclient

The supported data providers are the same ones available in the Project Wizard:


The command line processor will match the text specified by -dbprovider option in case insensitive fashion to one of the options in Supported Data Providers list.

Use mariadb or mysql for MySql or Maria DB server.

Use oracle for Oracle database.

Use ibm or db2 for DB2 databases.

Use sqlanywhere, postgres, or firebird for the corresponding database engines.

Automated App Building

The new command line support enables automated production of mobile and web applications with Code On Time app generator. Consider using Code On Time if you are a database administrator, application architect, or project manager. Just a few keystrokes will help to validate a database schema, provide high qualify data input screens, and eliminate tremendous amount of man hours.

Applications produced with Code On Time are metadata driven. Data modes and controllers are defined in XML files stored in ~/app/controllers folder of generated application. This makes possible to use the app generator to build apps from custom metadata. For example, a set of custom labels for table columns can be maintained in Excel spreadsheet or incorporated directly in the command line text manipulation commands. 

If your apply customization to data models then make sure to delete the corresponding data controllers. The app generator will build the dropped data controllers if you issue a -generate command. If you choose to modify the data controllers directly then the app will reflect the changes right away.

Code On Time v9

The upcoming new development environment incorporates the Project Designer and Object Inspector directly in the app. The development environment is activated at runtime from the app user interface. All project configuration options are arranged in a single hierarchy. The hierarchy will synchronize with the contents visible at the moment when developer activates "design" mode in the live app. Object Inspector presents properties of the selected hierarchy element in a unified presentation similar to the one found in Visual Studio. Developer will be able to perform live app inspection and drag hierarchy elements onto live pages.

New development environment is integrated into each app as add-on DLL. It will execute the app generator in command line mode when project configuration is changed. The add-on is removed from the code base when application is published.

The project creation and management will also change in v9. The app generator started without parameters will generate a management app displaying a list of projects. The management app will display in the default web browser.  A new project created from the management app will include a start page similar to the first app screenshot above. Developer will activate Project Designer from the live app to connect databases, create data models, pages, etc. 


Wednesday, May 22, 2019PrintSubscribe
Removing Header Text from Views
The responsive user interface of apps created with Code On Time is intuitive.  Nevertheless the grids and forms do display generic text to provide basic user instructions.

This is an example of a grid view with the header text displayed above the data.


This is how the data form may look.


Each description can be changed individually in the Project Designer.

If you prefer a minimalist user interface then the descriptions may appear to be excessive. The unique architecture of apps created with Code On Time makes possible altering various aspects of an app with a just few lines of code.

For example, enable shared business rules in your app by selecting the corresponding option in Settings | Database Model & Business Logic | Shared Business Rules section of the project configuration. Re-generate the app. If you have existing custom "code" business rules, then open each rule and change the base class from BusinessRules to SharedBusinessRules.

Application framework will create an instance of SharedBusinessRules class or a custom version of it whenever a client request is processed through the server-side code. The framework retrieves the XML description of the corresponding data controller to handle the request.Then it provides the app with a chance to perform changes to the in-memory copy of the data controller. If the matching business rules class indicates that it supports data controller virtualization (customization at runtime), then the customization code is invoked. By default, no customization is performed. Developer can override virtualization code to make changes to the controller.

The header text definitions in views of data controllers are as shown in this sample:



Changed the file ~/app/App_Code/custom/Rules/SharedBusinessRules.cs as follows:

namespace MyCompany.Rules
{
    public partial class SharedBusinessRules : MyCompany.Data.BusinessRules
    {

        public override bool SupportsVirtualization(string controllerName)
        {
            return true;
        }

        protected override void VirtualizeController(string controllerName)
        {
            NodeSet().SelectViews().SetHeaderText(string.Empty);
        }
    }
}

Save the code file and observe that all views in the app are displayed without descriptions:



You can customize your data controllers selectively by inspecting the name of the data controller specified in the argument of VirtualizeController method.

Take you minimalist presentation even further by removing category descriptions in form views with this code.

protected override void VirtualizeController(string controllerName)
{
    NodeSet().SelectViews().SetHeaderText(string.Empty)
        .SelectCategory("c1").SetHeaderText(string.Empty).SetDescription(string.Empty);
}

Your forms will now have an even more streamlined data-only presentation:


Wednesday, March 13, 2019PrintSubscribe
Faster Than Ever, Unlimited Trial With Fewer Limits
Release 8.7.10.0 is yet another steps towards the wonderful v9. This release features exceptional speed of code generation when you are making project design iterations. If you have an existing project created awhile ago, then make sure that you can generate it with the new release to get ready for Live Project Designer in Code On Time v9.

Unlimited Edition Trial is also included. The new release removes the limit on the number of data models in the project. You can create apps with any number of entities.

We are accepting requests for private live demonstrations of Offline Sync. A number of framework enhancements are introduced in the release in the preparation for the launch of this new exciting product. Just a few clicks will magically convert your online database app into disconnected (always offline) application.

If you would like to see the demo of Offline Sync then please open a support ticket and let us know your availability. Numerous changes to the Offline Data Processor (ODP) are included in the release. The completion date of ODP is rapidly approaching. We will switch the version numbering to 8.8.0.0 when ODP is released to production.

The following features and bug fixes are included in release 8.7.10.0:

  • (Touch UI) Calendar view correctly evaluates values of primary key fields when the presented in summary mode (dashboard).
  • (Client Library) Visible When and Read Only When expressions correctly evaluate $master.FieldName expressions.
  • (Offline Sync) Data download is initiated when "starting.app" event is triggered to prevent blinking.
  • (Framework) If an app without authentication is asked to confirm the user identity by Cloud On Time on branded app then a suggestion to add membership to the app is displayed. The app without a security system will not be installed.
  • (Model Builder) Command "Add all entities" will create data models for each remaining entity in alphabetic order.
  • (Touch UI) Tab bar algorithm shows "More" button with invisible tabs in fewer situations. Most of the time all tabs will be visible if there is a real estate on screen. Previously "..." option was rendered even when there was some space to fit the tabs at the bottom of the screen.
  • (Framework) Cached ~/touch-settings.json will be reloaded if it has changed or if web.config has changed.
  • (Project Wizard) New Project form does not show the name of the previously selected project in the window title anymore.
  • (Framework) Commit result is marked with date+time in "Date" property when returned to Offline Data Processor.
  • (Touch UI) Method $app.touch.toSmartDate(d) will return a smart date produced from the supplied date value.
  • (Framework) Exception is not raised when calling headerField() method on a data view that was not fully initialized.
  • (Touch UI) The text of static lookup items is presented correctly in grid/list/cards. Radio Button List, Check Box List, and List Box correctly show the selected value in edit mode for such items.
  • (Touch UI) The background of the field name in context menu displayed for field values is matched with the background color of the popup.
  • (ODP) If the entire set of rows is provided and the partially-loaded  set of rows does not exist then the row-by-row processing with key comparison is not performed.
  • (ODP) If pageSize is not defined in ODP configuration then the default value is 100.
  • (Touch UI) If event menuitem.app has stopped selection of menu item then the visual "selected" style is applied to the previously selected item.
  • (AppGen) Data access objects and Blob.generated.cs(vb) files are re-generated when controllers are changed.
  • (AppGen) Adaptive code generation minimizes transformation of unchanged files.
  • (AppGen) Publishing of the app will cause refresh of the ApplicationServices.Generated.cs(vb) file during the next code generation session.
  • (Framework) Arguments in the URL specified in the root of the app will not cause an exception when CMS is enabled.