Site Content CMS

AJAX(112) Apple(1) Application Builder(244) Application Factory(207) ASP.NET(95) ASP.NET 3.5(45) ASP.NET Code Generator(72) ASP.NET Membership(28) Azure(18) 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(11) 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) DotNetNuke(12) EASE(20) Email(6) Features(99) Firebird(1) Form Builder(14) Globalization and Localization(6) Hypermedia(2) Installation(4) 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(15) OAuth(6) OAuth Scopes(1) OAuth2(9) Offline(19) Offline Apps(4) Offline Sync(4) Oracle(10) PKCE(2) PostgreSQL(2) PWA(2) QR codes(2) Rapid Application Development(5) Reading Pane(2) Release Notes(166) Reports(48) REST(28) RESTful(25) RESTful Workshop(15) RFID tags(1) SaaS(7) Security(75) SharePoint(12) SPA(6) SQL Anywhere(3) SQL Server(26) Stored Procedure(4) Teamwork(15) Tips and Tricks(83) Tools for Excel(2) Touch UI(93) Transactions(5) Tutorials(183) Universal Windows Platform(3) User Interface(332) Video Tutorial(37) Web 2.0(100) Web App Generator(101) Web Application Generator(607) Web Form Builder(40) Web.Config(9) Workflow(28)
Tuesday, May 10, 2022PrintSubscribe
Site Content CMS

Business applications require a generic mechanism to store various types of system content. User avatars, access tokens, and dynamic configuration settings are just a few examples of such content


Applications created with Code On Time have the built-in Content Management System (CMS) that allows persisting the app-specific data at runtime. The single table named SiteContent acts as a file system for the app. The FileName and Path columns describe the virtual file location. The data is stored either in the Text column or in the binary Data column. The ContentType provides the MIME type information explaining the purpose of the data.

Virtual files in the Content Management System are described with the "Path" and "FileName". The data is stored either in the "Text" or in the binary "Data" columns. CMS marks the virtual files with the "CreatedDate" and "ModifiedDate" assigned to DateTime.UtcNow when the "files" are created and modified.
Virtual files in the Content Management System are described with the "Path" and "FileName". The data is stored either in the "Text" or in the binary "Data" columns. CMS marks the virtual files with the "CreatedDate" and "ModifiedDate" assigned to DateTime.UtcNow when the "files" are created and modified.

Administrators manually upload system content such as user avatars. The content can also be created in unattended fashion. For example, OAuth Authorization of the RESTful API Engine produces the system content to support the authorization flows.


Configuration of the application database connection string provides the Add button in the Content Management System section that installs the CMS when pressed. Application generator will create the corresponding data controller and the page to allow the administration of the system content. The framework looks up data in the CMS as needed.


User Avatars

Administrators assign the user avatars by uploading the images with the path sys/users and the file name matching the username. The framework will ignore the file extension when locating the user avatar during the login process. By default the user icon is a “blank” circle with the username initials.


If the image is uploaded to the CMS, then the icon is presented in the user interface of the app.


Follow these steps to create a user avatar:

  1. Sign into application as the user with the Administrator role.
  2. Navigate to the Site Content page.
  3. Press the “+” button in the bottom right corner of the page.
  4. Choose (custom) in the New Content form and press the OK button.
  5. Drag the user image onto the Data field placeholder from the File Explorer.
  6. Enter sys/users in the Path field.
  7. Change the File Name to match any username and keep the file extension.
  8. Press the Save button.
  9. Sign in as the user and the avatar will become visible in the application UI.


External OAuth Configuration

Application administrators have an option to enable the sign in for users with the Microsoft, Google, or Facebook account. The relevant options will automatically appear for each enabled provider along with the built-in membership-based login option.


The external OAuth provider configuration is recorded in the Site Content CMS. Administrators clicks the “+” button on the Site Content page and choose the Open Authentication Registration option to start the registration process.


The framework fetches the user avatar from the external Open Authentication Provider and saves it in the CMS.

OAuth Data Repository

The single page application SPA4 from the RESTful Workshop explains how to create a standalone app that uses the OAuth 2.0 Authorization built into the sample backend created with Code On Time to authenticate the users.

The CMS of the RESTful Backend Application maintains the following data records in the CMS:

  • Client application registration records.
  • CORs entries.
  • Authorization access requests.
  • Authorization access and refresh tokens.
  • OpenID user pictures.

Permanent and Temporary Content

Uploaded content types will remain in the database until explicitly removed.

RESTful API Engine performs automatic garbage collection, which involves the removal of the expired access requests and tokens. Each successful authorization deletes a small number of expired objects.