27.01.2015 Views

Best Practices of Plone Development

Best Practices of Plone Development

Best Practices of Plone Development

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1.8 Setup and Scaffolding 1 BEST PRACTICES FOR PLONE DEVELOPMENT<br />

1.8.6 Setup Script: CustomSetup.py<br />

• Boilerplate:<br />

class CustomSetup(SetupWidget):<br />

type = ’MyProduct Setup’<br />

description="Setup for ..."<br />

def available(self): return functions.keys()<br />

def installed(self): return []<br />

def addItems(self, fns):<br />

out = []<br />

for fn in fns:<br />

out.append((functions[fn]<br />

(self, self.portal),INFO))<br />

out.append(<br />

(’Function %s applied’ % fn, INFO))<br />

return out<br />

1.8.7 Calling Setup<br />

• portal_migrations, Setup<br />

• Can extend to list only un-applied setup, etc.<br />

– Helpful when doing laptop/dev server sync<br />

• Better: create a “customization policy” that spawns fully-customized site<br />

– Samplex product provides example <strong>of</strong> customization policy<br />

39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!