code: def generate_id(self, portal_type, batch_size = None):
          
          plone = getSite()
          portal_id = plone.getId()
  
          if portal_type == 'News Item':
              portal_type = 'NewsItem'
  
          idserver_url = os.environ.get('IDServerURL')
          try:
              if batch_size:
                  # GET
                  f = urllib.urlopen('%s/%s%s?%s' % (
                          idserver_url,
                          portal_id,
                          portal_type,
                          urllib.urlencode({'batch_size': batch_size}))
                          )
              else:
                  f = urllib.urlopen('%s/%s%s' % (
                      idserver_url, portal_id, portal_type
                      )
                  )
              id = f.read()
              f.close()
          except:
              from sys import exc_info
              info = exc_info()
              import zLOG; zLOG.LOG('INFO', 0, '', 'generate_id raised exception: %s, %s \n idserver_url: %s' % (info[0], info[1], idserver_url))
              raise IDServerUnavailable(_('ID Server unavailable'))
          return id
docs: Generate a new id for 'portal_type'