getting started with qcmagritte
DESCRIPTION
Title: Getting Started with QCMagritte Speaker: Stefan Eggermont Tue, August 19, 12:00pm – 12:30pm Video Part1: https://www.youtube.com/watch?v=mKZUhPNWFyI Video Part2: https://www.youtube.com/watch?v=vBPplUyDYyU Description Abstract: Magritte provides a nice way to describe your domain model and quickly build web components for your web application. QCMagritte offers you a.o. integration of Ajax, Bootstrap, user registration and dynamic support for multiple languages. Bring a laptop and see how to build a well-structured working web application in an hour. Bio: Stefan Eggermont is an independent consultant and software developer. He is interested in ways to make software development better and (even) more fun. He likes helping teams in becoming more able to add value to their organizations. After programming for 15 years, he discovered Seaside and Smalltalk and found out that there was a reasonable way to develop web applications after all. He also does Technology Roadmapping to help organizations realize and visualize their future(s).TRANSCRIPT
Getting Started with QCMagritte
Diego Lont & Stephan Eggermont
• Download a QCMagritte image fromhttp://ci.inria.org/pharo-contribution/QCMagritte
• Download a pharo vm fromhttp://get.pharo.org
• Download a QCMagritte demo fromhttp://smalltalkhub.com/mc/DiegoLont/QCMagritteDemo
dinsdag 19 augustus 14
What is QC-Magritte
• Application level framework
• On top of Seaside and Magritte
• Provides re-usable parts for common tasks
dinsdag 19 augustus 14
QCMagritte supports ...
Influences(AJAX)
ApplicationTemplate
Search (Queries)
Table support
Multi-language
Application navigation
User management
Menu structure
Hierarchical domain
structure
Commands
dinsdag 19 augustus 14
Example: CI• Continuous Integration Server
• Not focus of the talk
• Predefined with Magritte definitions
dinsdag 19 augustus 14
CI Model
Configuration
Build Definition
CI-Model TriggerProjectProjectProject
BuildBuildBuild
BuildStepBuildStepBuildStep
Trigger
dinsdag 19 augustus 14
Demo
• View magritte descriptions in model
dinsdag 19 augustus 14
Template• Application
• Seaside application, registering itself
• Points to model
• Creates menu
• Model
• Describes entry points for entire domain
• Defines builders used to generate components
dinsdag 19 augustus 14
Bootstrap template
QCBootstrapApplicationModel subclass: #CIBuildServerModel
QCBootstrapApplication subclass: #CIBuildServerApplication
CIBuildServerApplication>>title^'Demo CI'
CIBuildServerApplication>>model ^CIBuildServerModel default
CIBuildServerApplication class>>applicationName ^'Demo CI'
dinsdag 19 augustus 14
Demo• Show code
• Run tutorial:1
• Show application
• Add 2 projects
• 1 project defines steps and triggers
dinsdag 19 augustus 14
Default commands• CRUD
• User rights
• Domain constraints
CIProject>>canRemove^self builds isEmpty
dinsdag 19 augustus 14
Custom commands• Domain object has containerActions
• Label
• Condition
• ActionCIProject>>containerActions: aContainer<magritteContainer>^aContainer
addCommand: 'build' condition: #canBuild action: #startBuild;yourself
dinsdag 19 augustus 14
Custom components
• Easy extend model with custom components
• Demo: add status description + component
dinsdag 19 augustus 14
User Management• Only allow changes by logged in users
• Restrict access to views/actions
• Controlled by “hasUserManagent”
• Defaults to true if there is an admin user
• (CRUD) Rights and roles model.
dinsdag 19 augustus 14
Demo
• Add user management
dinsdag 19 augustus 14
QCMagritte supports ...
Influences(AJAX)
ApplicationTemplate
Search (Queries)
TableSupport
Multi-language
Application navigation
User management
Menu structure
Hierarchical domain
structure
Commands
dinsdag 19 augustus 14
Influences
• disable timeout
• user first, last name
• How to avoid cycles
dinsdag 19 augustus 14
Application navigation
• Mostly announcement based (still some call’s left, slowly being replaced)
• QCPageChoice shows how
dinsdag 19 augustus 14
Parent Object• Hierarchical ownership model for the domain
• Only one owner: parent
• Backlink to model = parent model
• QCQueriedToManyComponent
• search support
• newInstance sets parent if needed
dinsdag 19 augustus 14
Multilanguage• In-application support for multiple languages
• Each user can have own language preference
• Application has default language
• Keep default values for untranslated
• Default translation of labels, groups, comments, error messages. Others: asMultilanguageString
dinsdag 19 augustus 14
Search
• Model-wide search, from a starting point
• Description-type specific
• everything transformed to string representation
dinsdag 19 augustus 14
Table support• Select on field values, smart filter
• Sorting
• Export CSV
• Select columns
• Add calculated columns
dinsdag 19 augustus 14
Menu structure
• Tree based, announcements
• Autocollapse: expand current selection
dinsdag 19 augustus 14