SlideShare uma empresa Scribd logo
1 de 47
24.08.2014 - Page 1
Département
OfficeApp::AutoCRUD
An application for searching and
manipulating data in relational
databases
YAPC::EU::2014
laurent.dami@justice.ge.ch
Etat de Genève, Pouvoir Judiciaire
Département
Office
Agenda
• Introduction
• Overview (screenshots)
• Getting started
• Architecture
• Extensibility
• Conclusion
24.08.2014 - Page 1
Département
Office
Introduction
Business need : tool for the support team
Regular
Users
database
Regular
App
Database
Admins
Admin
Tools
Support
Team
? ? ?
Data access for support team
Needs
• Browse DB schema
• CRUD on all data
• Navigate
– Follow relationships
– Optimize for most common
tables and colums
Solutions
• Program an admin GUI
–  too much work !
• Give them DBA tools
–  too low-level
–  no customization
 Need a CRUD app !
CRUD landscape
Admin tools
Oracle SQLDeveloper
SQLite Sqliteman
Postgres pgadmin
phpMyAdmin
...
Ready
to use
Needs
programming
Fixed
features
Customizable
Scaffolding tools
Ruby on Rails
Catalyst
CatalystX::CRUD
...
AutoCRUD apps
Catalyst::Plugin::AutoCRUD (2011)
App::AutoCRUD (Jan 2014)
RapidApp (Feb 2014)
[ WebAPI::DBIC ] (Jul 2014)
Interchange TableEditor (2013??)
App::AutoCRUD main features
• Powerful search syntax
• Distinctive URL for every resource
–  no session, all information in URL
–  easy admin links from the "real App"
• Joins as hyperlinks
• Bulk update / delete operations
• Customizable table order / column order
• Navigation through tree navigator
24.08.2014 - Page 1
Département
Office
Quick overview
To run the demo :
cd examples
perl download_db.pl
plackup
Homepage
Specified in
config file
http://chinookdatabase.codeplex.com/
https://code.google.com/p/sakila-sample-database-ports/
Demo: free
sample
databases
Datasource entry point
Auto-generated
datamodel
Grouping, order & comments
from config file
Table description
Grouping, order & comments
from config file
Hyperlinks to foreign tables
from DB schema
Search form
Multiple values (OR)
LIKE
Multiple views
Choose
columns
BETWEEN
Results from search
Hyperlinks to foreign records or lists
Only show non-null columns
Also navigate through
LEFT/RIGHT arrow keys
Excel output
YAML output
Bulk update (selective)
2) Call the update form
1) Check records to be modified
Update form
Keys of selected records
Bulk update (from WHERE criteria)
Call the update form
Update form
Criteria for the update
Fields to update
± RESTful URLs
• /Chinook/table/Track/search?GenreId=1,3&Name=Ab*
– GET  display pre-filled search form
– POST  redirect to list
• /Chinook/table/Track/list?GenreId=1,3&Name=Ab*
–  search results
• /Chinook/table/Track/id/399
–  single record
• /Chinook/table/Track/delete?where_pk.TrackId=399
– GET  display pre-filled delete form
– POST  database operation
Note : browser-oriented, not API-oriented
 No use of HTTP methods PUT and DELETE
24.08.2014 - Page 1
Département
Office
Getting Started
YAML Config : connection parameters
app:
name: Test AutoCRUD
datasources :
Source1 :
dbh:
connect:
- dbi:SQLite:dbname=some_file
- "" # user
- "" # password
- RaiseError : 1
sqlite_unicode: 1
Config : specifying table grouping / ordering
tablegroups :
- name: Music
descr: Tables describing music content
node: open
tables :
- Artist
- Album
- Track
- name: Playlist
...
Config : specifying col grouping / ordering
Employee:
colgroups:
- name: keys
columns:
- name: EmployeeId
descr: primary key
- name: ReportsTo
descr: foreign key to the manager
- name: Employee details
columns:
- name: Title
- name: FirstName
- name: LastName
"crud.psgi" startup file
use App::AutoCRUD;
use YAML qw/LoadFile/;
my $config = LoadFile "/path/to/config.yaml";
my $crud = App::AutoCRUD->new(config => $config);
my $app = $crud->to_app;
Start the application
• From the command line
plackup crud.psgi
• Within Apache
<Location /crud>
SetHandler perl-script
PerlResponseHandler Plack::Handler::Apache2
PerlSetVar psgi_app /path/to/crud.psgi
</Location>
• Other possibilities : see L<Plack>
24.08.2014 - Page 1
Département
Office
Architecture : external modules
External modules : Global view
Template
Toolkit
Alien:
:GvaScript
Prototype.js
Excel::Writer:
:XLSX
View
DBIx::DataModel
DBI
SQL::Abstract:
:More
Model
Plack
CGI::Expand
SQL::Abstract:
:FromQuery
Controller
Infrastructure
Moose Data::DomainYAML
Infrastructure modules
• Moose for OO
– Modern Perl OO framework
• YAML for config data
– Human-readable
– Support for directed acyclic graph (DAG)  reusable subtrees
– But can be replaced by JSON, XML, Config::General or Perl source code
• Data::Domain for data validation
Controller modules
• Plack for HTTP support
– Abstraction over various engines
– Many middleware options
• CGI::Expand for transforming form inputs
– <input name="foo.1.bar" value=1234>
–  { foo => [ {...}, { bar => 1234 } ] }
• SQL::Abstract::FromQuery for parsing user queries
– HTML form  SQL::Abstract::More  SQL
– Parses booleans, < > !=, LIKE, BETWEEN, etc.
Model modules
• DBI for database independance
– Perl standard for databases
• DBIx::DataModel for object-relational mapping
– Why not DBIC ? See
http://www.slideshare.net/ldami/dbixclass-vs-
dbixdatamodel
• SQL::Abstract::More for SQL generation
– Emit SQL from Perl datastructures
View modules
• Template Toolkit for HTML generation
• Alien::GvaScript for widgets
– Tree::Navigator
• Prototype.js for Javascript abstraction
– Navigator abstraction, OO programming, etc.
• Excel::Writer::XLSX for generating Excel worksheets
–
24.08.2014 - Page 1
Département
Office
Architecture : internal structure
Internal structure : global view
AutoCRUD
AutoCRUD:
:View
AutoCRUD:
:Controller
AutoCRUD:
:Context
AutoCRUD:
:DataSource
Plack::Component Moose::Object
Controller:
:Table
Controller:
:Schema
View::XLSXView::TT ...
App::AutoCRUD
• Entry point
• Autodiscovers component subclasses
• isa Plack::Component
• Has
– Name
– Config
– Datasources
App::AutoCRUD::DataSource
• Encapsulates DBIx::DataModel schema
– Autogenerate Perl code if not already present
• Gathers and merges metadata
– From the DB schema
• Tables, columns, foreign keys
– From config
• Table groups, column groups, ordering, display parameters
App::AutoCRUD::Context
• Gathers contextual information for the current request
– Plack::Request object
– Datasource object
– View to apply
– Parameters for the view (for example TT template name)
Controller::Schema
• Lists table groups & tables
• Publishes the DBIx::DataModel schema
Controller::Table
• Implements CRUD operations
• Methods
– Descr
– List
– Id
– Search
– Update
– Delete
– Insert
View::*
• Render results
– TT
– XLSX
– YAML
– JSON
– ...
24.08.2014 - Page 1
Département
Office
Extensibility
Regular subclassing
• Extend the app
package My::Private::AutoCRUD;
use Moose;
extends 'App::AutoCRUD';
• Subclass and redefine existing methods
– Automatic subclass discovery
– Good candidates :
• DataSource::prepare_for_request
• DataSource::_query_parser
Adding URLs
• New controllers
– Crud/<db_name>/<controller_name>/....
• New methods in existing controllers
– Crud/<db_name>/table/<table_name>/<method>/...
Adding Views
• Create View/XYZ.pm with "render" method
– Serves /path/to/resource.xyz?p1=v1&p2=v2&...
Relooking
• Override CSS
– My/Private/AutoCRUD/share/static/css/styles.css
• Override TT templates
– My/Private/AutoCRUD/share/templates/src/table/list.tt
24.08.2014 - Page 1
Département
Office
Conclusion
Status
• Still young, lots of TODO
• Already in production at Geneva Justice
• Has some original features not seen other CRUD apps
• Could be useful for many people
– Also outside the Perl community 
•  Perl marketing needs general-purpose apps
– Needs stabilization & doc
– Needs marketing
– You can help !

Mais conteúdo relacionado

Mais procurados

U-SQL User-Defined Operators (UDOs) (SQLBits 2016)
U-SQL User-Defined Operators (UDOs) (SQLBits 2016)U-SQL User-Defined Operators (UDOs) (SQLBits 2016)
U-SQL User-Defined Operators (UDOs) (SQLBits 2016)Michael Rys
 
U-SQL Intro (SQLBits 2016)
U-SQL Intro (SQLBits 2016)U-SQL Intro (SQLBits 2016)
U-SQL Intro (SQLBits 2016)Michael Rys
 
U-SQL Killer Scenarios: Custom Processing, Big Cognition, Image and JSON Proc...
U-SQL Killer Scenarios: Custom Processing, Big Cognition, Image and JSON Proc...U-SQL Killer Scenarios: Custom Processing, Big Cognition, Image and JSON Proc...
U-SQL Killer Scenarios: Custom Processing, Big Cognition, Image and JSON Proc...Michael Rys
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)Michael Rys
 
Ingesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScriptIngesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScriptLucidworks
 
Bubbles – Virtual Data Objects
Bubbles – Virtual Data ObjectsBubbles – Virtual Data Objects
Bubbles – Virtual Data ObjectsStefan Urbanek
 
Amp and higher computing science
Amp and higher computing scienceAmp and higher computing science
Amp and higher computing scienceCharlie Love
 
Using C# with U-SQL (SQLBits 2016)
Using C# with U-SQL (SQLBits 2016)Using C# with U-SQL (SQLBits 2016)
Using C# with U-SQL (SQLBits 2016)Michael Rys
 
Introduction to Apache Hive | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache Hive | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Apache Hive | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache Hive | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Cassandra 3 new features @ Geecon Krakow 2016
Cassandra 3 new features  @ Geecon Krakow 2016Cassandra 3 new features  @ Geecon Krakow 2016
Cassandra 3 new features @ Geecon Krakow 2016Duyhai Doan
 
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)Michael Rys
 
Database2011 MySQL Sharding
Database2011 MySQL ShardingDatabase2011 MySQL Sharding
Database2011 MySQL ShardingMoshe Kaplan
 
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...Cloudera, Inc.
 
Hive @ Bucharest Java User Group
Hive @ Bucharest Java User GroupHive @ Bucharest Java User Group
Hive @ Bucharest Java User GroupRemus Rusanu
 
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...Michael Rys
 
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQLTaming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQLMichael Rys
 
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...Michael Rys
 
Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Airbnb Search Architecture: Presented by Maxim Charkov, AirbnbAirbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Airbnb Search Architecture: Presented by Maxim Charkov, AirbnbLucidworks
 
ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)Michael Rys
 
U-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance TuningU-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance TuningMichael Rys
 

Mais procurados (20)

U-SQL User-Defined Operators (UDOs) (SQLBits 2016)
U-SQL User-Defined Operators (UDOs) (SQLBits 2016)U-SQL User-Defined Operators (UDOs) (SQLBits 2016)
U-SQL User-Defined Operators (UDOs) (SQLBits 2016)
 
U-SQL Intro (SQLBits 2016)
U-SQL Intro (SQLBits 2016)U-SQL Intro (SQLBits 2016)
U-SQL Intro (SQLBits 2016)
 
U-SQL Killer Scenarios: Custom Processing, Big Cognition, Image and JSON Proc...
U-SQL Killer Scenarios: Custom Processing, Big Cognition, Image and JSON Proc...U-SQL Killer Scenarios: Custom Processing, Big Cognition, Image and JSON Proc...
U-SQL Killer Scenarios: Custom Processing, Big Cognition, Image and JSON Proc...
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
 
Ingesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScriptIngesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScript
 
Bubbles – Virtual Data Objects
Bubbles – Virtual Data ObjectsBubbles – Virtual Data Objects
Bubbles – Virtual Data Objects
 
Amp and higher computing science
Amp and higher computing scienceAmp and higher computing science
Amp and higher computing science
 
Using C# with U-SQL (SQLBits 2016)
Using C# with U-SQL (SQLBits 2016)Using C# with U-SQL (SQLBits 2016)
Using C# with U-SQL (SQLBits 2016)
 
Introduction to Apache Hive | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache Hive | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Apache Hive | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache Hive | Big Data Hadoop Spark Tutorial | CloudxLab
 
Cassandra 3 new features @ Geecon Krakow 2016
Cassandra 3 new features  @ Geecon Krakow 2016Cassandra 3 new features  @ Geecon Krakow 2016
Cassandra 3 new features @ Geecon Krakow 2016
 
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
 
Database2011 MySQL Sharding
Database2011 MySQL ShardingDatabase2011 MySQL Sharding
Database2011 MySQL Sharding
 
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...
Hadoop World 2011: Building Web Analytics Processing on Hadoop at CBS Interac...
 
Hive @ Bucharest Java User Group
Hive @ Bucharest Java User GroupHive @ Bucharest Java User Group
Hive @ Bucharest Java User Group
 
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...
Bring your code to explore the Azure Data Lake: Execute your .NET/Python/R co...
 
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQLTaming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
 
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
U-SQL Killer Scenarios: Taming the Data Science Monster with U-SQL and Big Co...
 
Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Airbnb Search Architecture: Presented by Maxim Charkov, AirbnbAirbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
 
ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)
 
U-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance TuningU-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance Tuning
 

Semelhante a App auto crud

Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoopclairvoyantllc
 
DMann-SQLDeveloper4Reporting
DMann-SQLDeveloper4ReportingDMann-SQLDeveloper4Reporting
DMann-SQLDeveloper4ReportingDavid Mann
 
Introduction to real time big data with Apache Spark
Introduction to real time big data with Apache SparkIntroduction to real time big data with Apache Spark
Introduction to real time big data with Apache SparkTaras Matyashovsky
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsMike Broberg
 
Frame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningFrame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningDavid Stein
 
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...Trivadis
 
Introduction to Apache Amaterasu (Incubating): CD Framework For Your Big Data...
Introduction to Apache Amaterasu (Incubating): CD Framework For Your Big Data...Introduction to Apache Amaterasu (Incubating): CD Framework For Your Big Data...
Introduction to Apache Amaterasu (Incubating): CD Framework For Your Big Data...DataWorks Summit
 
airflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxairflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxVIJAYAPRABAP
 
Apache Spark Data Source V2 with Wenchen Fan and Gengliang Wang
Apache Spark Data Source V2 with Wenchen Fan and Gengliang WangApache Spark Data Source V2 with Wenchen Fan and Gengliang Wang
Apache Spark Data Source V2 with Wenchen Fan and Gengliang WangDatabricks
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overviewKevin He
 
With Automated ML, is Everyone an ML Engineer?
With Automated ML, is Everyone an ML Engineer?With Automated ML, is Everyone an ML Engineer?
With Automated ML, is Everyone an ML Engineer?Dan Sullivan, Ph.D.
 
airflow web UI and CLI.pptx
airflow web UI and CLI.pptxairflow web UI and CLI.pptx
airflow web UI and CLI.pptxVIJAYAPRABAP
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nltieleman
 
Apache Ambari BOF - APIs - Hadoop Summit 2013
Apache Ambari BOF - APIs - Hadoop Summit 2013Apache Ambari BOF - APIs - Hadoop Summit 2013
Apache Ambari BOF - APIs - Hadoop Summit 2013Hortonworks
 
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Databricks
 
DBIx::Class vs. DBix::DataModel
DBIx::Class vs. DBix::DataModelDBIx::Class vs. DBix::DataModel
DBIx::Class vs. DBix::DataModelLaurent Dami
 
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"IT Event
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nlbartzon
 

Semelhante a App auto crud (20)

Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
 
DMann-SQLDeveloper4Reporting
DMann-SQLDeveloper4ReportingDMann-SQLDeveloper4Reporting
DMann-SQLDeveloper4Reporting
 
Introduction to real time big data with Apache Spark
Introduction to real time big data with Apache SparkIntroduction to real time big data with Apache Spark
Introduction to real time big data with Apache Spark
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 Questions
 
Frame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningFrame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine Learning
 
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...
 
Introduction to Apache Amaterasu (Incubating): CD Framework For Your Big Data...
Introduction to Apache Amaterasu (Incubating): CD Framework For Your Big Data...Introduction to Apache Amaterasu (Incubating): CD Framework For Your Big Data...
Introduction to Apache Amaterasu (Incubating): CD Framework For Your Big Data...
 
airflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxairflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptx
 
Apache Spark Data Source V2 with Wenchen Fan and Gengliang Wang
Apache Spark Data Source V2 with Wenchen Fan and Gengliang WangApache Spark Data Source V2 with Wenchen Fan and Gengliang Wang
Apache Spark Data Source V2 with Wenchen Fan and Gengliang Wang
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overview
 
With Automated ML, is Everyone an ML Engineer?
With Automated ML, is Everyone an ML Engineer?With Automated ML, is Everyone an ML Engineer?
With Automated ML, is Everyone an ML Engineer?
 
airflow web UI and CLI.pptx
airflow web UI and CLI.pptxairflow web UI and CLI.pptx
airflow web UI and CLI.pptx
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
 
Apache Ambari BOF - APIs - Hadoop Summit 2013
Apache Ambari BOF - APIs - Hadoop Summit 2013Apache Ambari BOF - APIs - Hadoop Summit 2013
Apache Ambari BOF - APIs - Hadoop Summit 2013
 
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
 
Web Ninja
Web NinjaWeb Ninja
Web Ninja
 
Open event presentation.3 2
Open event presentation.3 2Open event presentation.3 2
Open event presentation.3 2
 
DBIx::Class vs. DBix::DataModel
DBIx::Class vs. DBix::DataModelDBIx::Class vs. DBix::DataModel
DBIx::Class vs. DBix::DataModel
 
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
 

Mais de Laurent Dami

PowerPivot_model_Geneva_Justice_20230531.pptx
PowerPivot_model_Geneva_Justice_20230531.pptxPowerPivot_model_Geneva_Justice_20230531.pptx
PowerPivot_model_Geneva_Justice_20230531.pptxLaurent Dami
 
Studying geneva real estate prices using perl grammars
Studying geneva real estate prices using perl grammarsStudying geneva real estate prices using perl grammars
Studying geneva real estate prices using perl grammarsLaurent Dami
 
DBIx-DataModel v2.0 in detail
DBIx-DataModel v2.0 in detail DBIx-DataModel v2.0 in detail
DBIx-DataModel v2.0 in detail Laurent Dami
 
Gestion documentaire pour les tribunaux genevois
Gestion documentaire pour les tribunaux genevoisGestion documentaire pour les tribunaux genevois
Gestion documentaire pour les tribunaux genevoisLaurent Dami
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in PerlLaurent Dami
 
Emacs, a performant IDE for Perl
Emacs, a performant IDE for PerlEmacs, a performant IDE for Perl
Emacs, a performant IDE for PerlLaurent Dami
 
Managing Geneva's law courts, from Cobol to Perl
Managing Geneva's law courts, from Cobol to PerlManaging Geneva's law courts, from Cobol to Perl
Managing Geneva's law courts, from Cobol to PerlLaurent Dami
 

Mais de Laurent Dami (7)

PowerPivot_model_Geneva_Justice_20230531.pptx
PowerPivot_model_Geneva_Justice_20230531.pptxPowerPivot_model_Geneva_Justice_20230531.pptx
PowerPivot_model_Geneva_Justice_20230531.pptx
 
Studying geneva real estate prices using perl grammars
Studying geneva real estate prices using perl grammarsStudying geneva real estate prices using perl grammars
Studying geneva real estate prices using perl grammars
 
DBIx-DataModel v2.0 in detail
DBIx-DataModel v2.0 in detail DBIx-DataModel v2.0 in detail
DBIx-DataModel v2.0 in detail
 
Gestion documentaire pour les tribunaux genevois
Gestion documentaire pour les tribunaux genevoisGestion documentaire pour les tribunaux genevois
Gestion documentaire pour les tribunaux genevois
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in Perl
 
Emacs, a performant IDE for Perl
Emacs, a performant IDE for PerlEmacs, a performant IDE for Perl
Emacs, a performant IDE for Perl
 
Managing Geneva's law courts, from Cobol to Perl
Managing Geneva's law courts, from Cobol to PerlManaging Geneva's law courts, from Cobol to Perl
Managing Geneva's law courts, from Cobol to Perl
 

Último

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 

Último (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 

App auto crud

  • 1. 24.08.2014 - Page 1 Département OfficeApp::AutoCRUD An application for searching and manipulating data in relational databases YAPC::EU::2014 laurent.dami@justice.ge.ch Etat de Genève, Pouvoir Judiciaire Département Office
  • 2. Agenda • Introduction • Overview (screenshots) • Getting started • Architecture • Extensibility • Conclusion
  • 3. 24.08.2014 - Page 1 Département Office Introduction
  • 4. Business need : tool for the support team Regular Users database Regular App Database Admins Admin Tools Support Team ? ? ?
  • 5. Data access for support team Needs • Browse DB schema • CRUD on all data • Navigate – Follow relationships – Optimize for most common tables and colums Solutions • Program an admin GUI –  too much work ! • Give them DBA tools –  too low-level –  no customization  Need a CRUD app !
  • 6. CRUD landscape Admin tools Oracle SQLDeveloper SQLite Sqliteman Postgres pgadmin phpMyAdmin ... Ready to use Needs programming Fixed features Customizable Scaffolding tools Ruby on Rails Catalyst CatalystX::CRUD ... AutoCRUD apps Catalyst::Plugin::AutoCRUD (2011) App::AutoCRUD (Jan 2014) RapidApp (Feb 2014) [ WebAPI::DBIC ] (Jul 2014) Interchange TableEditor (2013??)
  • 7. App::AutoCRUD main features • Powerful search syntax • Distinctive URL for every resource –  no session, all information in URL –  easy admin links from the "real App" • Joins as hyperlinks • Bulk update / delete operations • Customizable table order / column order • Navigation through tree navigator
  • 8. 24.08.2014 - Page 1 Département Office Quick overview To run the demo : cd examples perl download_db.pl plackup
  • 11. Table description Grouping, order & comments from config file Hyperlinks to foreign tables from DB schema
  • 12. Search form Multiple values (OR) LIKE Multiple views Choose columns BETWEEN
  • 13. Results from search Hyperlinks to foreign records or lists Only show non-null columns Also navigate through LEFT/RIGHT arrow keys
  • 16. Bulk update (selective) 2) Call the update form 1) Check records to be modified
  • 17. Update form Keys of selected records
  • 18. Bulk update (from WHERE criteria) Call the update form
  • 19. Update form Criteria for the update Fields to update
  • 20. ± RESTful URLs • /Chinook/table/Track/search?GenreId=1,3&Name=Ab* – GET  display pre-filled search form – POST  redirect to list • /Chinook/table/Track/list?GenreId=1,3&Name=Ab* –  search results • /Chinook/table/Track/id/399 –  single record • /Chinook/table/Track/delete?where_pk.TrackId=399 – GET  display pre-filled delete form – POST  database operation Note : browser-oriented, not API-oriented  No use of HTTP methods PUT and DELETE
  • 21. 24.08.2014 - Page 1 Département Office Getting Started
  • 22. YAML Config : connection parameters app: name: Test AutoCRUD datasources : Source1 : dbh: connect: - dbi:SQLite:dbname=some_file - "" # user - "" # password - RaiseError : 1 sqlite_unicode: 1
  • 23. Config : specifying table grouping / ordering tablegroups : - name: Music descr: Tables describing music content node: open tables : - Artist - Album - Track - name: Playlist ...
  • 24. Config : specifying col grouping / ordering Employee: colgroups: - name: keys columns: - name: EmployeeId descr: primary key - name: ReportsTo descr: foreign key to the manager - name: Employee details columns: - name: Title - name: FirstName - name: LastName
  • 25. "crud.psgi" startup file use App::AutoCRUD; use YAML qw/LoadFile/; my $config = LoadFile "/path/to/config.yaml"; my $crud = App::AutoCRUD->new(config => $config); my $app = $crud->to_app;
  • 26. Start the application • From the command line plackup crud.psgi • Within Apache <Location /crud> SetHandler perl-script PerlResponseHandler Plack::Handler::Apache2 PerlSetVar psgi_app /path/to/crud.psgi </Location> • Other possibilities : see L<Plack>
  • 27. 24.08.2014 - Page 1 Département Office Architecture : external modules
  • 28. External modules : Global view Template Toolkit Alien: :GvaScript Prototype.js Excel::Writer: :XLSX View DBIx::DataModel DBI SQL::Abstract: :More Model Plack CGI::Expand SQL::Abstract: :FromQuery Controller Infrastructure Moose Data::DomainYAML
  • 29. Infrastructure modules • Moose for OO – Modern Perl OO framework • YAML for config data – Human-readable – Support for directed acyclic graph (DAG)  reusable subtrees – But can be replaced by JSON, XML, Config::General or Perl source code • Data::Domain for data validation
  • 30. Controller modules • Plack for HTTP support – Abstraction over various engines – Many middleware options • CGI::Expand for transforming form inputs – <input name="foo.1.bar" value=1234> –  { foo => [ {...}, { bar => 1234 } ] } • SQL::Abstract::FromQuery for parsing user queries – HTML form  SQL::Abstract::More  SQL – Parses booleans, < > !=, LIKE, BETWEEN, etc.
  • 31. Model modules • DBI for database independance – Perl standard for databases • DBIx::DataModel for object-relational mapping – Why not DBIC ? See http://www.slideshare.net/ldami/dbixclass-vs- dbixdatamodel • SQL::Abstract::More for SQL generation – Emit SQL from Perl datastructures
  • 32. View modules • Template Toolkit for HTML generation • Alien::GvaScript for widgets – Tree::Navigator • Prototype.js for Javascript abstraction – Navigator abstraction, OO programming, etc. • Excel::Writer::XLSX for generating Excel worksheets –
  • 33. 24.08.2014 - Page 1 Département Office Architecture : internal structure
  • 34. Internal structure : global view AutoCRUD AutoCRUD: :View AutoCRUD: :Controller AutoCRUD: :Context AutoCRUD: :DataSource Plack::Component Moose::Object Controller: :Table Controller: :Schema View::XLSXView::TT ...
  • 35. App::AutoCRUD • Entry point • Autodiscovers component subclasses • isa Plack::Component • Has – Name – Config – Datasources
  • 36. App::AutoCRUD::DataSource • Encapsulates DBIx::DataModel schema – Autogenerate Perl code if not already present • Gathers and merges metadata – From the DB schema • Tables, columns, foreign keys – From config • Table groups, column groups, ordering, display parameters
  • 37. App::AutoCRUD::Context • Gathers contextual information for the current request – Plack::Request object – Datasource object – View to apply – Parameters for the view (for example TT template name)
  • 38. Controller::Schema • Lists table groups & tables • Publishes the DBIx::DataModel schema
  • 39. Controller::Table • Implements CRUD operations • Methods – Descr – List – Id – Search – Update – Delete – Insert
  • 40. View::* • Render results – TT – XLSX – YAML – JSON – ...
  • 41. 24.08.2014 - Page 1 Département Office Extensibility
  • 42. Regular subclassing • Extend the app package My::Private::AutoCRUD; use Moose; extends 'App::AutoCRUD'; • Subclass and redefine existing methods – Automatic subclass discovery – Good candidates : • DataSource::prepare_for_request • DataSource::_query_parser
  • 43. Adding URLs • New controllers – Crud/<db_name>/<controller_name>/.... • New methods in existing controllers – Crud/<db_name>/table/<table_name>/<method>/...
  • 44. Adding Views • Create View/XYZ.pm with "render" method – Serves /path/to/resource.xyz?p1=v1&p2=v2&...
  • 45. Relooking • Override CSS – My/Private/AutoCRUD/share/static/css/styles.css • Override TT templates – My/Private/AutoCRUD/share/templates/src/table/list.tt
  • 46. 24.08.2014 - Page 1 Département Office Conclusion
  • 47. Status • Still young, lots of TODO • Already in production at Geneva Justice • Has some original features not seen other CRUD apps • Could be useful for many people – Also outside the Perl community  •  Perl marketing needs general-purpose apps – Needs stabilization & doc – Needs marketing – You can help !