SlideShare a Scribd company logo
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

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 

Recently uploaded (20)

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 

Featured

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
Marius Sescu
 
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
Expeed Software
 
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
Pixeldarts
 
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
 
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
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
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
Neil Kimberley
 
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)
contently
 
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
Albert Qian
 
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)
 
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
Search Engine Journal
 
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
SpeakerHub
 
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
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
Tessa Mero
 
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
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
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
MindGenius
 
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...
RachelPearson36
 

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.