Skip to Content
Apr 26, 2016 at 01:52 PM

Media/MIME config in Vocabulary-based SEGW project


Dear Gurus,

I successfully implemented an SEGW project with SAP Annotations already, which is working properly and managing attachments. Now I want to do the same within a project of Vocabulary-based annotations.

I got the error: 415 (Unsupported Media Type). This is due I do not know, how-to configure the entity and its properties in SEGW to set this entity as Media Type, I feel myself a bit lost.

What I already did, is that redefined the DEFINE method of Model Provider to set up the Property holding the Content Type:

  METHOD define.
    super->define( ).
    DATA(lo_entity_type) = model->get_entity_type( iv_entity_name = gc_attachment ).
    IF lo_entity_type IS BOUND.
      lo_entity_type->get_property( iv_property_name = 'MimeType' )->set_as_content_type( ).

set IsMediaType for the MimeType property

set MediaType for the binary content

set allowed file extensions both in MimeType and Content properties

and set MediaResource configuration, but all unsuccessfully:

I wiped the cache and got the same issue time to time in the standard, when processing a newly created entities. The processing in the gateway is dependent of the following statement: lo_entity_type->has_stream( ), which is always false, and therefore the entity is evaluated not as a Media(and in metadata there is no HasStream attribute for my Attachment entity), and the exception 415 (Unsupported Media Type) is raised by the GateWay. Our release is GW 740sp11.

Any advise is welcome 😊

Thank you


15_media_rsrc.png (49.4 kB)
05_entity_prop.png (80.1 kB)
06_entity_prop.png (56.2 kB)