def resource_to_portal_type(resource):
if resource is None:<EOL><INDENT>return None<EOL><DEDENT>resource_mapping = get_resource_mapping()<EOL>portal_type = resource_mapping.get(resource.lower())<EOL>if portal_type is None:<EOL><INDENT>logger.warn("<STR_LIT>"<EOL>"<STR_LIT>".format(resource))<EOL><DEDENT>return portal_type<EOL>
Converts a resource to a portal type

    :param resource: Resource name as it is used in the content route
    :type name: string
    :returns: Portal type name
    :rtype: string