Introduction
DRG CMS simplifies the programming of business applications. No database experience and only basic programming skills are needed to create a data entry program. You can do it in 6 easy steps.
Step 1: Create Model
Step 2: Generate Form
Step 3: Edit Form
Step 4: Define Labels and Help Text
Step 5: Create Controls File (if required)
Step 6: Include in Menu
Most of the time, you will end up with two source files.
Model file is a Ruby source file, which holds fields definitions, index definitions, dependencies, validations, transformations for a document (record). This is an example of a typical simple model file example.
include Mongoid::Document
include Mongoid::Timestamps
field :title, type: String
field :body, type: String
field :time_begin, type: DateTime
field :duration, type: Integer
field :search, type: String
field :user_id, type: BSON::ObjectId
index user_id: 1
validates :title, presence: true
validates :time_begin, presence: true
validates :duration, presence: true
end
Second is a form file. The form file is a text file, written in the YAML markup language, and defines fields and actions which make application web facing view.
table: note
index:
filter: title
actions: standard
result_set:
filter: current_users_documents
actions:
1: edit
columns:
10:
name: title
width: 25%
20:
name: time_started
width: 10%
format: '%d.%m.%Y'
30:
name: duration
form:
fields:
10:
name: user_id
type: readonly
eval: dc_name4_id,dc_user,name
default:
eval: 'session[:user_id]'
20:
name: title
type: text_field
size: 50
30:
name: time_started
type: datetime_picker
options:
step: 15
40:
name: duration
type: select
50:
name: body
type: html_field
options: "height: 500"
Include it into your application menu with this line:
And when you need advanced program logic, you will implement it in the controls source file.
DRG CMS uses Ruby on Rails, one of the most popular frameworks for building web sites. Ruby on Rails guarantees highest level of application security and huge base of extensions which will help you when your application grows.
DRG CMS uses MongoDB, leading NO-SQL document database, as database back-end with a help of mongoid gem. Mongoid's flexible document model defines all document fields, indexes, dependencies, validations in a single model file with no database migrations required.
DRG CMS can coexist with other frameworks which use MongoDB as database back-end. Use your favorite framework for presenting data on web and use DRG CMS with its easy to create DRG forms as data entry back-end.
DRG CMS can coexist with other databases and Rails controllers. I can highly recommend using DRG CMS in heterogeneous database Intranet projects. For the last few years, DRG has been used for development of an in-house Intranet portal which uses MongoDB as primary database and connects frequently to Oracle and MS-SQL databases.
I want to excuse for documentation quality. English is not my primary language, and there are probably lots of sentences which sound silly. I excuse for that. At least you get some fun reading otherwise boring documentation.
You are welcome to visit and give a star to DRG CMS project on GitHub. All DRG CMS sources, plugins and even sources for this web page are hosted on GitHub.
At last, I want to apologize to MongoDB fans. I know they are called collections not tables and documents not records. I am an old fart, and it's hard to keep old habits away. In my last documentation update, I tried to avoid domesticated terms as much as possible, but term record and table are widely used inside program internals and can not be avoided without large application refactoring.