Extending Apostrophe to build a variable-based CMS for rendering PDF brochures<br />Spike Brehm<br />Front-end Engineer @ ...
About Me<br />Symfony developer since 2009<br />@spikebrehm<br />About SunRun<br />The nation’s largest provider of Solar ...
The Problem<br />25 Partners<br />13 Markets<br />24 Utilities<br />Retail vs. direct sale<br />Maintaining Sales Document...
The Proposed Solution<br />“Let’s build a CMS so that our Sales team can maintain these documents and Engineering can focu...
Introducing: Flapjack<br />CMS for maintaining complex sales documents<br />symfony 1.4<br />Doctrine 1.x<br />apostropheP...
Introducing: Flapjack<br />
Why Apostrophe?<br />Experience<br />Built our corporate website on Apostrophe<br />Learned how to extend it at the app le...
The Data Model<br />Documents<br />Pages<br />Blocks<br />Widgets<br />Variables<br />Visibility filters<br />… srDocument...
Pages to Documents<br />Why create srPage instead of extending aPage?<br />
Slots to Pages: original<br />aPage can be both concrete and virtual.<br />Notice circular relationships.<br />
Slots to Pages: Flapjack<br />Instead of associating aBlogItem to aSlot using <br />the aSlot.value field, we use a join o...
Extending Apostrophe<br />Custom Slots<br />
Custom Slots<br />
Custom Slots<br />srStepListSlot:<br />  options:<br />symfony:<br />      form:   false<br />      filter: false<br />  i...
_normalView.php<br />
_editView.php<br />
srStepListSlotEditForm.class.php<br />
components.class.php<br />
getArrayValueParsed()???<br />
aSlot.class.php<br />
Variables: edit mode<br />
Variables: preview mode<br />
Upcoming SlideShare
Loading in …5
×

Extending Apostrophe to build a variable-based CMS for rendering PDF brochures

4,401 views
4,240 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,401
On SlideShare
0
From Embeds
0
Number of Embeds
34
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • How many of you have used Apostrophe? How does this look different from a typical Apostrophe site?
  • Extending Apostrophe to build a variable-based CMS for rendering PDF brochures

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

    ×