info.magnolia.dam
Class DamModule

java.lang.Object
  extended by info.magnolia.dam.DamModule

@Singleton
public class DamModule
extends Object

Dam Configuration Singleton.
This class is populated with informations defined under 'modules/dam/config'.

 Currently supported configuration:
   contentDisposition Voter: Used by the DamDownloadServlet to define if 'Content-Disposition' has to be set on the header response.
   enforceDocumentMimeType: Also used in DamDownloadServlet to define if ContentType has to be set on the response.
   mediaTypes: Define the list of supported MediaType. This media type define voters that link a mimeType to a MediaType (mimeType = 'video/.' --> Video MediaType)
 


Constructor Summary
DamModule()
           
 
Method Summary
 void addMediaType(String name, MediaType value)
          Add a MediaType.
 AssetRenderer getAssetRendererForMediaType(String mediaTypeName)
           
 AssetRenderer getAssetRendererForMimeType(String mimeType)
           
 info.magnolia.voting.Voter getContentDisposition()
           
 MediaType getMediaType(String mediaTypeId)
          Get the desired MediaType.
 String getMediaTypeForMimeType(String mimeType)
           
 Map<String,MediaType> getMediaTypes()
          Get the configured MediaType.
 boolean isEnforceDocumentMimeType()
           
 boolean isMediaTypeDefined(String mediaTypeName)
           
 void setContentDisposition(info.magnolia.voting.Voter contentDisposition)
           
 void setEnforceDocumentMimeType(boolean enforceDocumentMimeType)
           
 void setMediaTypes(Map<String,MediaType> mediaTypes)
          Set the MediaType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DamModule

public DamModule()
Method Detail

setContentDisposition

public void setContentDisposition(info.magnolia.voting.Voter contentDisposition)

getContentDisposition

public info.magnolia.voting.Voter getContentDisposition()

isEnforceDocumentMimeType

public boolean isEnforceDocumentMimeType()

setEnforceDocumentMimeType

public void setEnforceDocumentMimeType(boolean enforceDocumentMimeType)

getMediaTypes

public Map<String,MediaType> getMediaTypes()
Get the configured MediaType.


getMediaType

public MediaType getMediaType(String mediaTypeId)
Get the desired MediaType.


setMediaTypes

public void setMediaTypes(Map<String,MediaType> mediaTypes)
Set the MediaType.


addMediaType

public void addMediaType(String name,
                         MediaType value)
Add a MediaType.


isMediaTypeDefined

public boolean isMediaTypeDefined(String mediaTypeName)
Returns:
true if the given MediaType is defined.

getAssetRendererForMediaType

public AssetRenderer getAssetRendererForMediaType(String mediaTypeName)
Returns:
the AssetRenderer implementation class associated to the given mediaTypeName. Null if not found.

getMediaTypeForMimeType

public String getMediaTypeForMimeType(String mimeType)
Returns:
the MediaType Name associated to the given mimeType. Null otherwise.

getAssetRendererForMimeType

public AssetRenderer getAssetRendererForMimeType(String mimeType)
Returns:
the AssetRenderer implementation class associated to the given mimeType. Null if not found.


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.