Get Started!

General.Utilities

A set of tools and controls to extend the NetCanvas General assembly.

Dependencies

The Utilities assembly requires that the Net4orce.Canvas.General assembly is installed, as a dynamic or static assembly.

Installer

The Utilities assembly has a built-in installer that is executed when the Install button is clicked, on the lower portion of the Dynamic Assembly List Page.

Installer

Installable Assemblies

In addition to the git clone and compiler, the install adds a number of additional resources and add some sections.

New Sections

The install adds the following sections :

  • Visitor Activity

    If tracking is enabled, every request into the server is tracked.

  • Visitor RealTime

    If tracking is enabled, the RealTime section renders a map with the current visitors.

  • Submissions

    Any Form submissions / enquiries to the site can be viewed & exported as an Excel file.

Controls

There's a set of controls that can be used.

Dynamic Form

The Net4orce.Canvas.General.Utilities/DynamicForms/contactus.ascx ASCX is a general use control to render an enquiry or submission form with a wide range of options for enabling different fields and defining which are required for the submission.

Gallery

The Net4orce.Canvas.General.Utilities/Gallery/main.ascx ASCX is a control that, as the name suggests, renders a gallery that an Author can populate with images and descriptions.

Each Image item in the gallery is stored in mongoDB as :

  • Net4orce.Canvas.General.Imgs.Img

Gallery Options

Here's some Example JSON Options for the gallery.

{
  "cType": "RECENT-PROJECTS",
  "bExtendedType": true,         
  "cExtendedTypeParam": "project-name",
  "cListItemCtrl": "Net4orce.Canvas.General.Utilities.Gallery.Item",
  "cDataItemType": "Net4orce.Canvas.General.WebPages.WebPage",
  "nDataItemId": 43,
  "cWidth": "300",
  "cHeight": "300",
  "cColor": "#fff",
  "cBackground": "#ccc"
}

The bExtendedType and cExtendedTypeParam properties are used in combination with cType to derive the string used to match Imgs.Img from the dataBase for the specific gallery.

In the example above the param project-name is extracted from the request and then appended to the cType / "RECENT-PROJECTS".

CTAs

The Net4orce.Canvas.General.Utilities/CTAs/main.ascx ASCX is a general use "Call To Action" button that needs to be associated with a DataSource of type WebPage.

IT allow the Author to define the Caption, Icon and the destination URL for the visitor when clicked.

Custom CTA

As with all of the controls, you can inherit from this CTA and replace the click handler with one that, say, opens a Modal with the Dynamic Form in for the visitor to submit.

Tracker

The Net4orce.Canvas.General.Utilities/Visitors/Tracker/main.ascx ASCX is used to enable the Visitor Activity tracker. Include the Tracker control as a Persistent ASCX into any PlaceHolder / Template location via the designer and the tracker will automatically start recording all visitor and robot a activity / requests.

Tracker Load & Efficiency

Significant effort has been made to assure that the Tracker does not negatively impair the speed of the site's response. This is achieved by passing the tracking logic off to a separate thread, which has the execution delayed until the HTML has been flushed by the server.

Moreover, additional effort around the DB update commands has been taken so that the low-level mongoDB commands such as $set, $inc etc. are used, rather than unnecessary serialization of whole the data items during the write to the persistent data store.