Using the Portal Setup tool to reverse Engineer a profile change
Goal: Add a new display view to an existing content type. Specifically, a new template called "mynewview.pt" has been added to a skin layer via a new Plone 3 product. This template needs to be registered with the portal_types tool as an optional display view for the Folder type.
The stock "Available View Methods" for a Folder are
folder_summary_view (in portal_skins/plone_content)
folder_tabular_view (in portal_skins/plone_content)
atct_album_view (in portal_skins/ATContentTypes)
folder_listing (in portal_skins/plone_content)
1. Create mynewview.pt and include it in the new product.
2. Using the ZMI, go to portal_types > Folder and add "mynewview" as an available view method. Save the change.
3.Use the Portal Setup tool > export tab to select and export the Types Tool.
This will download a TAR file containing the types.xml file and a folder named "types" which contains one file for each content type. Examine the types/folder.xml file for the configuration including the addition of
<property name="view_methods">
...
<element value="mynewview"/>
...
</property>
4. Based on the output from 3, we can create types.xml, types/, and types/folder.xml files in our product's profiles/default/ directory.
Types.xml and Folder.xml should contain only the minimum necessary code to add mynewview to the existing content type.
from GenericSetup Quick Reference Card
When importing items such as property sheets, make sure not to override other profile settings by setting the purge attribute to False. This will add the items listed to the property instead of resetting the property. Example:
<property name=”metaTypesNotToList” type=”lines” purge=”False”> <element value=”File”/> <element value=”Image”/> </property>
Only use the configuration that you need. When you export your site’s configuration, it will include things that you don’t need. For example, if you needed to change only the ‘Allow anonymous to view about’ property, this is what your propertiestool.xml would look like:
<?xml version=”1.0”?>
<object name=”portal_properties” meta_type=”Plone Properties Tool”>
<object name=”site_properties” meta_type=”Plone Property Sheet”>
<property name=”allowAnonymousViewAbout” type=”boolean”>True</property>
</object>
</object>
Uninstall
Few people ever write uninstall profiles for GenericSetup. It is totally doable.
see http://plone.org/documentation/tutorial/genericsetup/creating-an-uninstall-profile
see also https://weblion.psu.edu/trac/weblion/wiki/PloneThreeUninstallProfile