## Script (Python) "getSearchableContentTypes"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=portal_types=0
##title=
##

if portal_types:
    # portal_type compatible
    list = [topic.getId() for topic in context.portal_topicmaps.getTopicTypes()]
    list.append('Topic')
else:
    # Type-compatible
    list = [unicode(topic.getBaseName(), 'latin-1') for topic in context.portal_topicmaps.getTopicTypes()]
    list.append( context.portal_types.Topic.Title() ) 

#XXX: This method should be ramcached
#XXX: We ought to retrieve this from portal_types instead.

list.sort()

return list
