SlideShare a Scribd company logo
1 of 28
ModelAdmin
                SilverStripe’s great new tool for building CRMs
                                (and other things)




Monday, March 2, 2009
We develop a CMS
Monday, March 2, 2009
We do other stu
                              too!
                    • Most of our sites include a CMS
                    • But also: CRM, event management,
                      e-commerce, internal business
                      systems
                    • The CMS paradigm doesn’t fit all of
                      these

Monday, March 2, 2009
Let’s build a CRM!

                    • We’ve made CRMs for SilverStripe
                        ... several, in fact
                    • Each time we had a “CRM”
                      customer, it seemed that they
                      wanted something dierent


Monday, March 2, 2009
Flexible Data, Fixed
                         UI
                    • Clients are very specific about data
                      and business logic
                    • But not about user interface - as
                      long as it’s good, they’re happy
                    • SilverStripe CMS exploits this by
                      making it easy to create new Page
                      Types with custom fields

Monday, March 2, 2009
From CMS to DMS

                    • Can we apply this concept to CRM?
                    • Don’t just manage Content
                    • Manage any kind of Data



Monday, March 2, 2009
ModelAdmin
                    • Data Management built into
                      SilverStripe
                    • ModelAdmin gives you a CRUD
                      interface around any data: Search,
                      Results, Detail
                    • Same building blocks as CMS
                      interface

Monday, March 2, 2009
ModelAdmin

                    • Search on fields linked by relations
                    • Detail record gives you a scaolded
                      interface for editing all relations



Monday, March 2, 2009
Monday, March 2, 2009
Monday, March 2, 2009
Monday, March 2, 2009
Code Demo



Monday, March 2, 2009
Random example: A small webhosting company
     with products, customers and contracts


                              * Web2.0ified by http://
                                     creatr.cc
Monday, March 2, 2009
Our Datamodel
                                 HostingContrac
                Customer                            HostingType
                                        t

                           has_many           has_one




Monday, March 2, 2009
HostingType
                    ?php
                    class HostingType extends DataObject {
                        static $db = array(
                            'Title' = 'Text',
                            'Description' = 'Text',
                            'Price' = 'Float',
                        );
                        static $has_many = array(
                            'HostingContracts' = 'HostingContract',
                        );
                    }
                    ?


                                   mysite/code/HostingType.php


Monday, March 2, 2009
HostingType




Monday, March 2, 2009
HostingContract
                         ?php
                         class HostingContract extends DataObject {
                             static $db = array(
                                 'ContractNumber' = 'Varchar',
                                 'StartDate' = 'Date',
                                 'EndDate' = 'Date'
                             );
                             static $has_one = array(
                                 'Customer' = 'Customer',
                                 'HostingType' = 'HostingType',
                             );
                         }
                         ?
                               mysite/code/HostingContract.php


Monday, March 2, 2009
HostingContract




Monday, March 2, 2009
Customer
                   ?php
                   class Customer extends Member {
                       static $db = array(
                           'CustomerType' = quot;Enum('Private,Business','Private')quot;
                       );
                       static $has_one = array(
                           'Avatar' = 'Image',
                       );
                       static $has_many = array(
                           'HostingContracts' = 'HostingContract'
                       );
                   }
                   ?
                                    mysite/code/Customer.php


Monday, March 2, 2009
Monday, March 2, 2009
MyCRMAdmin
         ?php
         class MyCRMAdmin extends ModelAdmin {
             protected static $managed_models = array(
                 'Customer',
                 'HostingContract',
                 'HostingType'
             );
             static $url_segment = 'mycrm'; // will be linked as /admin/mycrm
             static $menu_title = 'My CRM';
         }
         ?


                             mysite/code/MyCRMAdmin.php


Monday, March 2, 2009
Some tweaking...



Monday, March 2, 2009
Summary Fields
                          ?php
                          class Customer extends Member {
                              // ...
                              static $summary_fields = array(
                                  'FirstName',
                                  'Surname',
                                  'CustomerType'
                              );
                          }
                          ?




Monday, March 2, 2009
Searchable Fields
                          ?php
                          class Customer extends Member {
                              // ...
                              static $searchable_fields = array(
                                  'FirstName',
                                  'Surname',
                                  'HostingContracts.ContractNumber'
                              );
                          }
                          ?




Monday, March 2, 2009
getCMSFields()
                        ?php
                        class Customer extends Member {
                            // ...
                            function getCMSFields() {
                                $fields = parent::getCMSFields();
                                $fields-removeByName('Locale');

                                 return $fields;
                             }
                        }
                        ?




Monday, March 2, 2009
Using Data on




Monday, March 2, 2009
SilverStripe 2.4 and
                        beyond
                        • New data mapper
                        • Thinner, reusable
                          controllers
                        • “Intelligent data”



Monday, March 2, 2009
Thank you
                                  Download this talk at:
                    http://www.slideshare.net/chillu/modeladmin-in-silverstripe-23


                                       Code         (requires SilverStripe 2.3+)

                        http://silverstripe.org/assets/presentations/2009-02-28-
                                     modeladminpresentationmysite.zip



                                Ingo Schommer, SilverStripe Ltd., ingo@silverstripe.com
                             License: http://creativecommons.org/licenses/by-nc/3.0/nz/



Monday, March 2, 2009

More Related Content

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

ModelAdmin in SilverStripe 2.3

  • 1. ModelAdmin SilverStripe’s great new tool for building CRMs (and other things) Monday, March 2, 2009
  • 2. We develop a CMS Monday, March 2, 2009
  • 3. We do other stu too! • Most of our sites include a CMS • But also: CRM, event management, e-commerce, internal business systems • The CMS paradigm doesn’t fit all of these Monday, March 2, 2009
  • 4. Let’s build a CRM! • We’ve made CRMs for SilverStripe ... several, in fact • Each time we had a “CRM” customer, it seemed that they wanted something dierent Monday, March 2, 2009
  • 5. Flexible Data, Fixed UI • Clients are very specific about data and business logic • But not about user interface - as long as it’s good, they’re happy • SilverStripe CMS exploits this by making it easy to create new Page Types with custom fields Monday, March 2, 2009
  • 6. From CMS to DMS • Can we apply this concept to CRM? • Don’t just manage Content • Manage any kind of Data Monday, March 2, 2009
  • 7. ModelAdmin • Data Management built into SilverStripe • ModelAdmin gives you a CRUD interface around any data: Search, Results, Detail • Same building blocks as CMS interface Monday, March 2, 2009
  • 8. ModelAdmin • Search on fields linked by relations • Detail record gives you a scaolded interface for editing all relations Monday, March 2, 2009
  • 13. Random example: A small webhosting company with products, customers and contracts * Web2.0ified by http:// creatr.cc Monday, March 2, 2009
  • 14. Our Datamodel HostingContrac Customer HostingType t has_many has_one Monday, March 2, 2009
  • 15. HostingType ?php class HostingType extends DataObject { static $db = array( 'Title' = 'Text', 'Description' = 'Text', 'Price' = 'Float', ); static $has_many = array( 'HostingContracts' = 'HostingContract', ); } ? mysite/code/HostingType.php Monday, March 2, 2009
  • 17. HostingContract ?php class HostingContract extends DataObject { static $db = array( 'ContractNumber' = 'Varchar', 'StartDate' = 'Date', 'EndDate' = 'Date' ); static $has_one = array( 'Customer' = 'Customer', 'HostingType' = 'HostingType', ); } ? mysite/code/HostingContract.php Monday, March 2, 2009
  • 19. Customer ?php class Customer extends Member { static $db = array( 'CustomerType' = quot;Enum('Private,Business','Private')quot; ); static $has_one = array( 'Avatar' = 'Image', ); static $has_many = array( 'HostingContracts' = 'HostingContract' ); } ? mysite/code/Customer.php Monday, March 2, 2009
  • 21. MyCRMAdmin ?php class MyCRMAdmin extends ModelAdmin { protected static $managed_models = array( 'Customer', 'HostingContract', 'HostingType' ); static $url_segment = 'mycrm'; // will be linked as /admin/mycrm static $menu_title = 'My CRM'; } ? mysite/code/MyCRMAdmin.php Monday, March 2, 2009
  • 23. Summary Fields ?php class Customer extends Member { // ... static $summary_fields = array( 'FirstName', 'Surname', 'CustomerType' ); } ? Monday, March 2, 2009
  • 24. Searchable Fields ?php class Customer extends Member { // ... static $searchable_fields = array( 'FirstName', 'Surname', 'HostingContracts.ContractNumber' ); } ? Monday, March 2, 2009
  • 25. getCMSFields() ?php class Customer extends Member { // ... function getCMSFields() { $fields = parent::getCMSFields(); $fields-removeByName('Locale'); return $fields; } } ? Monday, March 2, 2009
  • 26. Using Data on Monday, March 2, 2009
  • 27. SilverStripe 2.4 and beyond • New data mapper • Thinner, reusable controllers • “Intelligent data” Monday, March 2, 2009
  • 28. Thank you Download this talk at: http://www.slideshare.net/chillu/modeladmin-in-silverstripe-23 Code (requires SilverStripe 2.3+) http://silverstripe.org/assets/presentations/2009-02-28- modeladminpresentationmysite.zip Ingo Schommer, SilverStripe Ltd., ingo@silverstripe.com License: http://creativecommons.org/licenses/by-nc/3.0/nz/ Monday, March 2, 2009

Editor's Notes

  1. Talk briefly about the CMS.