예제 #1
0
def install(self):

    out = StringIO()

    # Set parentMetaTypesNotToQuery
    portalProperties = getToolByName(self, 'portal_properties')
    navtreeProps = getattr(portalProperties, 'navtree_properties')
    addToListProperty(self, out, navtreeProps, 'parentMetaTypesNotToQuery',
                      'PoiTracker')
    addToListProperty(self, out, navtreeProps, 'parentMetaTypesNotToQuery',
                      'PoiIssue')
    addToListProperty(self, out, navtreeProps, 'parentMetaTypesNotToQuery',
                      'PoiPscTracker')

    # Add PoiPscTracker to allowed types in PSCProject
    typesTool = getToolByName(self, 'portal_types')
    addAllowedContentType(self, out, typesTool, 'PSCProject', 'PoiPscTracker')

    # Control what happens when posting a new issue.
    controller = getToolByName(self, 'portal_form_controller')
    addFormControllerAction(self, out, controller, 'validate_integrity',
                            'success', 'PoiIssue', None, 'traverse_to',
                            'string:poi_issue_post')

    addCatalogIndexes(self, out)

    # Add log action
    ttool = getToolByName(self, 'portal_types')
    removeAction(self, out, ttool, 'log', 'object')
    addAction(self, out, ttool, 'log', 'Log', 'string:$object_url/log',
              'nocall: object/@@log|nothing', 'View', 'object', 1)

    return out.getvalue()
예제 #2
0
def uninstall(self):
    out = StringIO()

    # Remove log action
    ttool = getToolByName(self, 'portal_types')
    removeAction(self, out, ttool, 'log', 'object')

    return out.getvalue()