## Script (Python) "SE_makeDCType"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
# SE_makeDCType
#
# SE_makeDCType - Search External client module
#
# match 'portal_type' from REQUEST into DCMI Type Vocabulary
#
# (C) 2003 by CC Open Computer Systems for the "Neuroinfo" project
# This is free software avaiable under the GPL license, see:
#   LICENSE.txt, README.txt for details.
# ==================================================================
request = container.REQUEST

translate_tab = {
  'portal_type' : 'dc_type',

  'Document'            : 'text',

  'Software'            : 'software',
  'Model'               : 'software',
  'Text'                : 'text',
  'Article'             : 'text',
  'Dataset'             : 'dataset',
  'DataSet'             : 'dataset',
  'Collection'          : 'collection',
  'Event'               : 'event',
  'Image'               : 'image',
  'Service'             : 'service',
  'Sound'               : 'sound',
  'PhysicalObject'      : 'physicalObject',
  'InteractiveResource' : 'interactiveResource',
}

# Return a string identifying this script.
type_list = request.get('portal_type', '')

tmp_list = []
dc_type = ''

for i in type_list:
    if translate_tab.has_key(i):
        if translate_tab[i] not in tmp_list:
            dc_type += translate_tab[i]
            dc_type += ';'
            tmp_list.append(translate_tab[i])


return dc_type
