The mediaContent item type has a mediaType property that indicates the type of binary file the item’s url property points to. The mediaType property is an enumerated property that accepts the following values:

The mediaType property is set automatically by the /atg/content/service/MimeCategoryTyper component, which is of class atg.servlet.MimeCategoryTyper. This component uses the /atg/dynamo/servlet/pipeline/MimeTyper component to examine the filename extension of the mediaContent item’s url property and determine the corresponding MIME type. For example, if the extension is mpeg, MimeTyper returns video/mpeg as the MIME type.

MimeCategoryTyper then examines the MIME type returned by MimeTyper and returns one of the MIME categories listed above. For example, if the MIME type is image/jpeg or image/gif (or any other image type), MimeCategoryTyper returns Image.

MimeCategoryTyper has properties for specifying strings that it attempts to match with the MIME type to determine the MIME category:

Each of these properties is a Map in which the keys are strings used for comparison with MIME types, and the values are MIME categories. To return the appropriate MIME category, MimeCategoryTyper uses the following logic:

The MimeCategoryTyper component’s properties file includes the following:

mimeTyper=/atg/dynamo/servlet/pipeline/MimeTyper
startsWithCategories=\
image=Image, \
video=Video, \
audio=Audio
endsWithCategories=\
pdf=PDF
defaultCategory=Other

So, for example, if the MIME type is video/mpeg, the MIME category is Video; if the MIME type is application/pdf, the MIME category is PDF; and if the MIME type is application/rtf, the MIME category is Other.


Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices