SlideShare a Scribd company logo
1 of 22
Extending Apostrophe to build a variable-based CMS for rendering PDF brochures Spike Brehm Front-end Engineer @ SunRun, Inc.
About Me Symfony developer since 2009 @spikebrehm About SunRun The nation’s largest provider of Solar Power Service – think SaaS Complex business model and fragmented markets Able to scale quickly because of software tools
The Problem 25 Partners 13 Markets 24 Utilities Retail vs. direct sale Maintaining Sales Documents Custom document for each combination (25 * 13 * … ) Flat PHP files, edited by hand Symlinks on the filesystem to approximate reuse
The Proposed Solution “Let’s build a CMS so that our Sales team can maintain these documents and Engineering can focus on building more cool tools!”
Introducing: Flapjack CMS for maintaining complex sales documents symfony 1.4 Doctrine 1.x apostrophePlugin 1.4 apostropheBlogPlugin 1.4
Introducing: Flapjack
Why Apostrophe? Experience Built our corporate website on Apostrophe Learned how to extend it at the app level Don’t reinvent the wheel Rich text editor templates Framework for building custom slots (widgets)
The Data Model Documents Pages Blocks Widgets Variables Visibility filters … srDocument … srPage -> aPage … aBlogItem … aSlot … srParsedVariable(not Doctrine) … srVisibilityFilterSchema … srVisibilityFilter … srVisibilityExpressionSchema … srVisibilityExpressionGroup … srVisibilityExpression … srVisibilityConsequent
Pages to Documents Why create srPage instead of extending aPage?
Slots to Pages: original aPage can be both concrete and virtual. Notice circular relationships.
Slots to Pages: Flapjack Instead of associating aBlogItem to aSlot using  the aSlot.value field, we use a join object srBlogItemBlockSlot for many-to-many. Note: simplified visibility filter schema.
Extending Apostrophe Custom Slots
Custom Slots
Custom Slots srStepListSlot:   options: symfony:       form:   false       filter: false   inheritance:     extends: aSlot     type: column_aggregation keyField: type keyValue: 'srStepList' ./symfonyapostrophe:generate-slot-type   --application=frontend --type=srStepList ?  apps/frontend/lib/form/srStepListSlotEditForm.class.php ?  apps/frontend/modules/srStepListSlot/actions/actions.class.php ?  apps/frontend/modules/srStepListSlot/actions/components.class.php ?  apps/frontend/modules/srStepListSlot/templates/_normalView.php ?  apps/frontend/modules/srStepListSlot/templates/_editView.php M  config/doctrine/schema.yml ./symfonydoctrine:build --all-classes ?  lib/model/doctrine/srStepListSlot.class.php ?  lib/model/doctrine/srStepListSlotTable.class.php ?  lib/model/doctrine/base/BasesrStepListSlot.class.php M  lib/model/doctrine/apostrophePlugin/base/BaseaSlot.class.php
_normalView.php
_editView.php
srStepListSlotEditForm.class.php
components.class.php
getArrayValueParsed()???
aSlot.class.php
Variables: edit mode
Variables: preview mode

More Related Content

Similar to Building a variable-based CMS for rendering PDF brochures with Apostrophe

Which Tools Are The Best For Symfony Projects_.pdf
Which Tools Are The Best For Symfony Projects_.pdfWhich Tools Are The Best For Symfony Projects_.pdf
Which Tools Are The Best For Symfony Projects_.pdfMoon Technolabs Pvt. Ltd.
 
Which Tools Are The Best For Symfony Projects_.pdf
Which Tools Are The Best For Symfony Projects_.pdfWhich Tools Are The Best For Symfony Projects_.pdf
Which Tools Are The Best For Symfony Projects_.pdfMoon Technolabs Pvt. Ltd.
 
The distinct advantages of using PHP-Symfony Framework
The distinct advantages of using PHP-Symfony FrameworkThe distinct advantages of using PHP-Symfony Framework
The distinct advantages of using PHP-Symfony FrameworkMindfire LLC
 
Adobe jax2010 1_dashboard
Adobe jax2010 1_dashboardAdobe jax2010 1_dashboard
Adobe jax2010 1_dashboardguest9776673
 
Salesforce pros and cons
Salesforce pros and consSalesforce pros and cons
Salesforce pros and consAmit Chaudhari
 
Force.com (Salesforce.com)
Force.com (Salesforce.com)Force.com (Salesforce.com)
Force.com (Salesforce.com)Vijay Maurya
 
Microsoft Dynamics CRM - XRM Advantage for Solution Builders Whitepaper
Microsoft Dynamics CRM - XRM Advantage for Solution Builders WhitepaperMicrosoft Dynamics CRM - XRM Advantage for Solution Builders Whitepaper
Microsoft Dynamics CRM - XRM Advantage for Solution Builders WhitepaperMicrosoft Private Cloud
 
Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...
Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...
Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...Multimedia Communications Lab
 
Key 101: Social Next: The Evolution of Collaboration To The Leading Social Pl...
Key 101: Social Next: The Evolution of Collaboration To The Leading Social Pl...Key 101: Social Next: The Evolution of Collaboration To The Leading Social Pl...
Key 101: Social Next: The Evolution of Collaboration To The Leading Social Pl...Franck Horowitz
 
Getting the Most out of EPMA: HFM Managing Metadata with EPMA
Getting the Most out of EPMA: HFM Managing Metadata with EPMAGetting the Most out of EPMA: HFM Managing Metadata with EPMA
Getting the Most out of EPMA: HFM Managing Metadata with EPMAfinitsolutions
 
SharePoint Framework SPFx
SharePoint Framework SPFxSharePoint Framework SPFx
SharePoint Framework SPFxVladimir Medina
 
BAM: Open Source Brand Asset Management in the Amazon Cloud
BAM: Open Source Brand Asset Management in the Amazon CloudBAM: Open Source Brand Asset Management in the Amazon Cloud
BAM: Open Source Brand Asset Management in the Amazon CloudMatthew Patulski
 
BP207: Don't Reinvent the Wheel - (Re)use Open Source Software From OpenNTF
BP207: Don't Reinvent the Wheel - (Re)use Open Source Software From OpenNTFBP207: Don't Reinvent the Wheel - (Re)use Open Source Software From OpenNTF
BP207: Don't Reinvent the Wheel - (Re)use Open Source Software From OpenNTFChristian Güdemann
 
Symfony framework-An overview and usability for web development
Symfony framework-An overview and usability for web developmentSymfony framework-An overview and usability for web development
Symfony framework-An overview and usability for web developmentifour_bhavesh
 
Startup Engineering Cookbook
Startup Engineering CookbookStartup Engineering Cookbook
Startup Engineering CookbookManish Jain
 
7 Reasons Why Umbraco CMS is the Best for Small Business
7 Reasons Why Umbraco CMS is the Best for Small Business7 Reasons Why Umbraco CMS is the Best for Small Business
7 Reasons Why Umbraco CMS is the Best for Small BusinessEdwardallen40
 
What’s New in Extended ECM 16 EP2?
What’s New in Extended ECM 16 EP2?What’s New in Extended ECM 16 EP2?
What’s New in Extended ECM 16 EP2?Thomas Demmler
 

Similar to Building a variable-based CMS for rendering PDF brochures with Apostrophe (20)

Which Tools Are The Best For Symfony Projects_.pdf
Which Tools Are The Best For Symfony Projects_.pdfWhich Tools Are The Best For Symfony Projects_.pdf
Which Tools Are The Best For Symfony Projects_.pdf
 
Applications Report
Applications ReportApplications Report
Applications Report
 
Which Tools Are The Best For Symfony Projects_.pdf
Which Tools Are The Best For Symfony Projects_.pdfWhich Tools Are The Best For Symfony Projects_.pdf
Which Tools Are The Best For Symfony Projects_.pdf
 
The distinct advantages of using PHP-Symfony Framework
The distinct advantages of using PHP-Symfony FrameworkThe distinct advantages of using PHP-Symfony Framework
The distinct advantages of using PHP-Symfony Framework
 
Adobe jax2010 1_dashboard
Adobe jax2010 1_dashboardAdobe jax2010 1_dashboard
Adobe jax2010 1_dashboard
 
WPEngine Summit 2019
WPEngine Summit 2019WPEngine Summit 2019
WPEngine Summit 2019
 
Salesforce pros and cons
Salesforce pros and consSalesforce pros and cons
Salesforce pros and cons
 
Force.com (Salesforce.com)
Force.com (Salesforce.com)Force.com (Salesforce.com)
Force.com (Salesforce.com)
 
Microsoft Dynamics CRM - XRM Advantage for Solution Builders Whitepaper
Microsoft Dynamics CRM - XRM Advantage for Solution Builders WhitepaperMicrosoft Dynamics CRM - XRM Advantage for Solution Builders Whitepaper
Microsoft Dynamics CRM - XRM Advantage for Solution Builders Whitepaper
 
Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...
Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...
Social Learning and Knowledge Sharing Technologies Lecture Slides about Socia...
 
Key 101: Social Next: The Evolution of Collaboration To The Leading Social Pl...
Key 101: Social Next: The Evolution of Collaboration To The Leading Social Pl...Key 101: Social Next: The Evolution of Collaboration To The Leading Social Pl...
Key 101: Social Next: The Evolution of Collaboration To The Leading Social Pl...
 
Getting the Most out of EPMA: HFM Managing Metadata with EPMA
Getting the Most out of EPMA: HFM Managing Metadata with EPMAGetting the Most out of EPMA: HFM Managing Metadata with EPMA
Getting the Most out of EPMA: HFM Managing Metadata with EPMA
 
SharePoint Framework SPFx
SharePoint Framework SPFxSharePoint Framework SPFx
SharePoint Framework SPFx
 
BAM: Open Source Brand Asset Management in the Amazon Cloud
BAM: Open Source Brand Asset Management in the Amazon CloudBAM: Open Source Brand Asset Management in the Amazon Cloud
BAM: Open Source Brand Asset Management in the Amazon Cloud
 
BP207: Don't Reinvent the Wheel - (Re)use Open Source Software From OpenNTF
BP207: Don't Reinvent the Wheel - (Re)use Open Source Software From OpenNTFBP207: Don't Reinvent the Wheel - (Re)use Open Source Software From OpenNTF
BP207: Don't Reinvent the Wheel - (Re)use Open Source Software From OpenNTF
 
Symfony framework-An overview and usability for web development
Symfony framework-An overview and usability for web developmentSymfony framework-An overview and usability for web development
Symfony framework-An overview and usability for web development
 
Startup Engineering Cookbook
Startup Engineering CookbookStartup Engineering Cookbook
Startup Engineering Cookbook
 
7 Reasons Why Umbraco CMS is the Best for Small Business
7 Reasons Why Umbraco CMS is the Best for Small Business7 Reasons Why Umbraco CMS is the Best for Small Business
7 Reasons Why Umbraco CMS is the Best for Small Business
 
Introducing symfony
Introducing symfonyIntroducing symfony
Introducing symfony
 
What’s New in Extended ECM 16 EP2?
What’s New in Extended ECM 16 EP2?What’s New in Extended ECM 16 EP2?
What’s New in Extended ECM 16 EP2?
 

More from Spike Brehm

Managing Through Chaos (w/ presenter notes)
Managing Through Chaos (w/ presenter notes)Managing Through Chaos (w/ presenter notes)
Managing Through Chaos (w/ presenter notes)Spike Brehm
 
Managing Through Chaos
Managing Through ChaosManaging Through Chaos
Managing Through ChaosSpike Brehm
 
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendSpike Brehm
 
Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with SprocketsSpike Brehm
 
Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Spike Brehm
 
JSConf US 2014: Building Isomorphic Apps
JSConf US 2014: Building Isomorphic AppsJSConf US 2014: Building Isomorphic Apps
JSConf US 2014: Building Isomorphic AppsSpike Brehm
 
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsIn Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsSpike Brehm
 
General Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptGeneral Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptSpike Brehm
 
Isomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master ClassIsomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master ClassSpike Brehm
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverSpike Brehm
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondSpike Brehm
 

More from Spike Brehm (11)

Managing Through Chaos (w/ presenter notes)
Managing Through Chaos (w/ presenter notes)Managing Through Chaos (w/ presenter notes)
Managing Through Chaos (w/ presenter notes)
 
Managing Through Chaos
Managing Through ChaosManaging Through Chaos
Managing Through Chaos
 
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's Frontend
 
Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with Sprockets
 
Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)
 
JSConf US 2014: Building Isomorphic Apps
JSConf US 2014: Building Isomorphic AppsJSConf US 2014: Building Isomorphic Apps
JSConf US 2014: Building Isomorphic Apps
 
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript AppsIn Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
 
General Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptGeneral Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScript
 
Isomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master ClassIsomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master Class
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and Beyond
 

Recently uploaded

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Building a variable-based CMS for rendering PDF brochures with Apostrophe

  • 1. Extending Apostrophe to build a variable-based CMS for rendering PDF brochures Spike Brehm Front-end Engineer @ SunRun, Inc.
  • 2. About Me Symfony developer since 2009 @spikebrehm About SunRun The nation’s largest provider of Solar Power Service – think SaaS Complex business model and fragmented markets Able to scale quickly because of software tools
  • 3. The Problem 25 Partners 13 Markets 24 Utilities Retail vs. direct sale Maintaining Sales Documents Custom document for each combination (25 * 13 * … ) Flat PHP files, edited by hand Symlinks on the filesystem to approximate reuse
  • 4. The Proposed Solution “Let’s build a CMS so that our Sales team can maintain these documents and Engineering can focus on building more cool tools!”
  • 5. Introducing: Flapjack CMS for maintaining complex sales documents symfony 1.4 Doctrine 1.x apostrophePlugin 1.4 apostropheBlogPlugin 1.4
  • 7. Why Apostrophe? Experience Built our corporate website on Apostrophe Learned how to extend it at the app level Don’t reinvent the wheel Rich text editor templates Framework for building custom slots (widgets)
  • 8. The Data Model Documents Pages Blocks Widgets Variables Visibility filters … srDocument … srPage -> aPage … aBlogItem … aSlot … srParsedVariable(not Doctrine) … srVisibilityFilterSchema … srVisibilityFilter … srVisibilityExpressionSchema … srVisibilityExpressionGroup … srVisibilityExpression … srVisibilityConsequent
  • 9. Pages to Documents Why create srPage instead of extending aPage?
  • 10. Slots to Pages: original aPage can be both concrete and virtual. Notice circular relationships.
  • 11. Slots to Pages: Flapjack Instead of associating aBlogItem to aSlot using the aSlot.value field, we use a join object srBlogItemBlockSlot for many-to-many. Note: simplified visibility filter schema.
  • 14. Custom Slots srStepListSlot: options: symfony: form: false filter: false inheritance: extends: aSlot type: column_aggregation keyField: type keyValue: 'srStepList' ./symfonyapostrophe:generate-slot-type --application=frontend --type=srStepList ? apps/frontend/lib/form/srStepListSlotEditForm.class.php ? apps/frontend/modules/srStepListSlot/actions/actions.class.php ? apps/frontend/modules/srStepListSlot/actions/components.class.php ? apps/frontend/modules/srStepListSlot/templates/_normalView.php ? apps/frontend/modules/srStepListSlot/templates/_editView.php M config/doctrine/schema.yml ./symfonydoctrine:build --all-classes ? lib/model/doctrine/srStepListSlot.class.php ? lib/model/doctrine/srStepListSlotTable.class.php ? lib/model/doctrine/base/BasesrStepListSlot.class.php M lib/model/doctrine/apostrophePlugin/base/BaseaSlot.class.php

Editor's Notes

  1. How many of you have used Apostrophe? How does this look different from a typical Apostrophe site?