(self)
return cached_getTargetFormatItemList(self.getBaseContentType())
Returns a list of acceptable formats for conversion
      in the form of tuples (for listfield in ERP5Form)

      NOTE: it is the responsability of the conversion server
      to provide an extensive list of conversion formats.
Returns a list of acceptable formats for conversion
      in the form of tuples (for listfield in ERP5Form)
Returns a list of acceptable formats for conversion in the form of tuples ( for listfield in ERP5Form )
def getTargetFormatItemList(self):
    """
      Returns a list of acceptable formats for conversion
      in the form of tuples (for listfield in ERP5Form)

      NOTE: it is the responsability of the conversion server
      to provide an extensive list of conversion formats.
    """
    if not self.hasBaseData():
      # if we have no date we can not format it
      return []

    def cached_getTargetFormatItemList(content_type):
      from xmlrpclib import Fault
      server_proxy = DocumentConversionServerProxy(self)
      try:
        allowed_target_item_list = server_proxy.getAllowedTargetItemList(
                                                      content_type)
        try:
          response_code, response_dict, response_message = \
                                             allowed_target_item_list
        except ValueError:
          # Compatibility with older oood where getAllowedTargetItemList only
          # returned response_dict
          response_code, response_dict, response_message = \
                         200, dict(response_data=allowed_target_item_list), ''

        if response_code == 200:
          allowed = response_dict['response_data']
        else:
          # This is very temporary code - XXX needs to be changed
          # so that the system can retry
          raise ConversionError("OOoDocument: can not get list of allowed acceptable"
                                " formats for conversion (Code %s: %s)" % (
                                      response_code, response_message))

      except Fault:
        allowed = server_proxy.getAllowedTargets(content_type)
        warn('Your oood version is too old, using old method '
            'getAllowedTargets instead of getAllowedTargetList',
             DeprecationWarning)

      # tuple order is reversed to be compatible with ERP5 Form
      return [(y, x) for x, y in allowed]

    # Cache valid format list
    cached_getTargetFormatItemList = CachingMethod(
                                cached_getTargetFormatItemList,
                                id="OOoDocument_getTargetFormatItemList",
                                cache_factory='erp5_ui_medium')

    return cached_getTargetFormatItemList(self.getBaseContentType())
def getTargetFormatItemList ( self ) : if not self . hasBaseData ( ) : # if we have no date we can not format it return [ ] def cached_getTargetFormatItemList ( content_type ) : from xmlrpclib import Fault server_proxy = DocumentConversionServerProxy ( self ) try : allowed_target_item_list = server_proxy . getAllowedTargetItemList ( content_type ) try : response_code , response_dict , response_message = allowed_target_item_list except ValueError : # Compatibility with older oood where getAllowedTargetItemList only # returned response_dict response_code , response_dict , response_message = 200 , dict ( response_data = allowed_target_item_list ) , '' if response_code == 200 : allowed = response_dict [ 'response_data' ] else : # This is very temporary code - XXX needs to be changed # so that the system can retry raise ConversionError ( "OOoDocument: can not get list of allowed acceptable" " formats for conversion (Code %s: %s)" % ( response_code , response_message ) ) except Fault : allowed = server_proxy . getAllowedTargets ( content_type ) warn ( 'Your oood version is too old, using old method ' 'getAllowedTargets instead of getAllowedTargetList' , DeprecationWarning ) # tuple order is reversed to be compatible with ERP5 Form return [ ( y , x ) for x , y in allowed ] # Cache valid format list cached_getTargetFormatItemList = CachingMethod ( cached_getTargetFormatItemList , id = "OOoDocument_getTargetFormatItemList" , cache_factory = 'erp5_ui_medium' ) return cached_getTargetFormatItemList ( self . getBaseContentType ( ) )