Andreas Hartmann wrote:
Felix Röthenbacher schrieb:
Andreas Hartmann schrieb:

I'd like to introduce the method

  String[] ResourceType.getSupportedMimeTypes()

Purpose:

* Resource types can be restricted to particular mime types.

* When a document is created, the repository can throw an exception if the mime type is not supported by the resource type.

* Upload (and WebDAV access etc.) can be safely enabled for various resource types.

* The Firedocs editor (and maybe other editors?) requires a list of mime-types for asset upload. IMO configuring this at resource type level makes the most sense.


The configuration could look like this, e.g. for the "resource" resource type:

  <mime-types>
    image/jpg, image/gif, image/png,
    application/pdf
  </mime-types>


Better

<supports>
  <mime-type>image/jpg</mime-type>
  <mime-type>image/gif</mime-type>
  <mime-type>image/png</mime-type>
  <mime-type>application/pdf</mime-type>
</supports>

Is the intention of the generic <supports> element to allow for later additions, like e.g. a maximum content-length value? Otherwise I find it a bit unusual to use a generic element as the parent of specific elements. Most schemas would probably use

<mime-types>
  <mime-type>image/jpg</mime-type>
  <mime-type>image/gif</mime-type>
  <mime-type>image/png</mime-type>
  <mime-type>application/pdf</mime-type>
</mime-types>

But I'm +0 to use <supports> as the parent.

WDOT?

-- Andreas



This suggestion comes from the portlet deployment descriptor where they
use the <supports> tag to define the allowed mime-types for a portlet. Using <supports> makes clear that the following mime-types are
supported.

If you want to keep it open for later additions it would be better to
use

<supports>
  <mime-types>
    <mime-type>image/jpg</mime-type>
  </mime-types>
  <some-addition> ... </some-addition>
</supports>


- Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to