Your SlideShare is downloading. ×
Generic Setup De-Mystified
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Generic Setup De-Mystified

1,285

Published on

A talk focusing on the GenericSetup tool and it's use in Plone. NOTE: There were a couple screencasts that won't transfer to the slides.

A talk focusing on the GenericSetup tool and it's use in Plone. NOTE: There were a couple screencasts that won't transfer to the slides.

Published in: Technology
1 Comment
3 Likes
Statistics
Notes
No Downloads
Views
Total Views
1,285
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
1
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. GenericSetup De-mystified Clayton Parker Plone Symposium East 2009 nowhere to go but open source s ix fe e tup . co m / i mm e rs e
  • 2. Who am I? • Lead Developer at Six Feet Up, Inc. • claytron on IRC s ixf eet up. c om/ i mme r se
  • 3. What’s in store? • The what and why of GenericSetup • Importing and exporting • Best practices • portal_setup vs. portal_quickinstaller s ixf eet up. c om/ i mme r se
  • 4. What? • portal_quickinstaller replacement • CustomizationPolicy replacement • Site configuration • Upgrades s ixf eet up. c om/ i mme r se
  • 5. Why? “Persistence means always having to say you’re sorry” - Seaver’s Law s ixf eet up. c om/ i mme r se
  • 6. Install.py == sadness s ixf eet up. c om/ i mme r se
  • 7. GenericSetup Profiles • Base profile • Extension profile s ixf eet up. c om/ i mme r se
  • 8. What’s in a profile? <genericsetup:registerProfile name=quot;defaultquot; title=quot;My Packagequot; directory=quot;profiles/defaultquot; description=quot;My Package install profilequot; provides=quot;Products.GenericSetup.interfaces.EXTENSIONquot; /> • profile-<package_name>:<profile_name> • profile-my.package:default • my.package:default s ixf eet up. c om/ i mme r se
  • 9. On the filesystem my.package/my/package/ | |- configure.zcml |- exportimport/ | |- profiles/ | | | |- default/ | | | |- metadata.xml | |- my.package-default.txt | |- <other profile files> | |- setuphandlers.py |- upgrades.py s ixf eet up. c om/ i mme r se
  • 10. s ixf eet up. c om/ i mme r se
  • 11. s ixf eet up. c om/ i mme r se
  • 12. s ixf eet up. c om/ i mme r se
  • 13. s ixf eet up. c om/ i mme r se
  • 14. s ixf eet up. c om/ i mme r se
  • 15. metadata.xml <?xml version=quot;1.0quot;?> <metadata> <version>1.0</version> <dependencies> <dependency>profile-my.theme:default</dependency> <dependency>profile-my.other.package:default</dependency> </dependencies> </metadata> s ixf eet up. c om/ i mme r se
  • 16. s ixf eet up. c om/ i mme r se
  • 17. Careful with that axe, Eugene... s ixf eet up. c om/ i mme r se
  • 18. s ixf eet up. c om/ i mme r se
  • 19. Tell me more • Profile for initial site setup • Upgrade steps s ixf eet up. c om/ i mme r se
  • 20. Upgrade steps <genericsetup:upgradeStep title=quot;Setup calendarquot; description=quot;Modify the calendar settingsquot; source=quot;0.9quot; destination=quot;1.0quot; handler=quot;.upgrades.setupCalendarquot; sortkey=quot;10quot; profile=quot;my.package:defaultquot; /> s ixf eet up. c om/ i mme r se
  • 21. Upgrade steps from Products.CMFCore.utils import getToolByName def setupCalendar(context): ctool = getToolByName(context, 'portal_calendar') cal_types = list(ctool.calendar_types) if 'MyEventType' not in cal_types: cal_types.append('MyEventType') ctool.calendar_types = cal_types s ixf eet up. c om/ i mme r se
  • 22. Best Practices • Uninstall profiles • Trim the export • Be aware of other profiles s ixf eet up. c om/ i mme r se
  • 23. <property name=quot;metaTypesNotToListquot; type=quot;linesquot;> <element value=quot;ATBooleanCriterionquot;/> <element value=quot;ATDateCriteriaquot;/> <element value=quot;ATDateRangeCriterionquot;/> <element value=quot;ATListCriterionquot;/> ... </property> <property name=quot;metaTypesNotToListquot; type=quot;linesquot; purge=quot;Falsequot;> <element value=quot;Imagequot;/> <element value=quot;Filequot;/> </property> s ixf eet up. c om/ i mme r se
  • 24. portal_setup vs. portal_quickinstaller s ixf eet up. c om/ i mme r se
  • 25. def install(portal): quot;quot;quot;Run the GS profile to install this packagequot;quot;quot; out = StringIO() runProfile(portal, 'profile-my.package:default') print >>out, quot;Installed my.packagequot; return out.getvalue() def uninstall(portal, reinstall=False): quot;quot;quot;Run the GS profile to install this packagequot;quot;quot; out = StringIO() if not reinstall: runProfile(portal, 'profile-my.package:uninstall') print >>out, quot;Uninstalled my.packagequot; return out.getvalue() s ixf eet up. c om/ i mme r se
  • 26. Make me a Zope 2 style product <five:registerPackage package=quot;.quot; initialize=quot;.initializequot;/> s ixf eet up. c om/ i mme r se
  • 27. What did we learn? • The what and why of GenericSetup • Importing and exporting • Best practices • portal_setup vs. portal_quickinstaller s ixf eet up. c om/ i mme r se
  • 28. Links • http://www.sixfeetup.com/swag/generic-setup-quick-reference-card • http://plone.org/documentation/manual/generic-setup/ s ixf eet up. c om/ i mme r se
  • 29. Learn Plone by building a website from A to Z 1 non-profit project • 10 workshops • 14 mentors • 3 days s ixf eetup. com/im merse Register by June 30th and save $255!

×