from Globals import package_home

def install(self):
    """ Import the topicmanagement topicmap. """
    filename = package_home(globals()) + '/../topicmanagement.xtm'
    file = open(filename, "rb")
    self.portal_topicmaps.importTopicMap(REQUEST=None, RESPONSE=None, file=file)
    file.close()
    self.portal_topicmaps.manage_update_all()
    for action in self.portal_types.file.listActions():
        if action.id == 'view':
            action.setActionExpression('topic_file_view')
