net.sourceforge.openutils.mgnlmedia.media.configuration
Class MediaConfigurationManager

java.lang.Object
  extended by info.magnolia.cms.beans.config.ObservedManager
      extended by net.sourceforge.openutils.mgnlmedia.media.configuration.MediaConfigurationManager

public class MediaConfigurationManager
extends info.magnolia.cms.beans.config.ObservedManager

ObservedManager that keeps that media types configuration.
Each media type is defined under the mediatypes contentnode in /modules/media.
I.e.
/modules/media/mediatypes/pdf

Author:
molaschi

Field Summary
static info.magnolia.cms.core.ItemType FOLDER
          Folder type
static info.magnolia.cms.core.ItemType MEDIA
          Media type
static info.magnolia.cms.core.ItemType RESOLUTIONS
          Resolutions node type
 
Fields inherited from class info.magnolia.cms.beans.config.ObservedManager
registeredUUIDs
 
Constructor Summary
MediaConfigurationManager()
           
 
Method Summary
 Collection<info.magnolia.cms.core.Content> find(String path, String type, String search, boolean recursive)
          Deprecated. use the find method overload based on Magnolia Criteria API
static MediaConfigurationManager getInstance()
          Get singleton instance
static MediaTypeConfiguration getMediaHandlerFromExtension(String extension)
          Get the media type from a file extension
 MediaTypeConfiguration getMediaTypeConfigurationFromMedia(info.magnolia.cms.core.Content media)
          Get the type configuration for a media
 Map<String,MediaTypeConfiguration> getTypes()
          Get all media type map
 String getURIMappingPrefix()
          Get uri mapping for repo
 List<String> getUsedInWebPages(String uuid)
          Get the list of web pages where a media is used
protected  void onClear()
          
protected  void onRegister(info.magnolia.cms.core.Content node)
          
 Collection<info.magnolia.cms.core.Content> search(String text, String type)
          Deprecated. use SearchMediaQueryConfiguration.search(...)
 
Methods inherited from class info.magnolia.cms.beans.config.ObservedManager
clear, register, reload, reload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOLDER

public static final info.magnolia.cms.core.ItemType FOLDER
Folder type


MEDIA

public static final info.magnolia.cms.core.ItemType MEDIA
Media type


RESOLUTIONS

public static final info.magnolia.cms.core.ItemType RESOLUTIONS
Resolutions node type

Constructor Detail

MediaConfigurationManager

public MediaConfigurationManager()
Method Detail

onClear

protected void onClear()

Specified by:
onClear in class info.magnolia.cms.beans.config.ObservedManager

onRegister

protected void onRegister(info.magnolia.cms.core.Content node)

Specified by:
onRegister in class info.magnolia.cms.beans.config.ObservedManager

getInstance

public static MediaConfigurationManager getInstance()
Get singleton instance

Returns:
singleton instance

getMediaHandlerFromExtension

public static MediaTypeConfiguration getMediaHandlerFromExtension(String extension)
Get the media type from a file extension

Parameters:
extension - file extension
Returns:
media type

getTypes

public Map<String,MediaTypeConfiguration> getTypes()
Get all media type map

Returns:
media type map

getUsedInWebPages

public List<String> getUsedInWebPages(String uuid)
                               throws javax.jcr.query.InvalidQueryException,
                                      javax.jcr.RepositoryException
Get the list of web pages where a media is used

Parameters:
uuid - uuid of media
Returns:
list of web pages where a media is used
Throws:
javax.jcr.query.InvalidQueryException - invalid query
javax.jcr.RepositoryException - repository exception

search

@Deprecated
public Collection<info.magnolia.cms.core.Content> search(String text,
                                                                    String type)
                                                  throws javax.jcr.RepositoryException
Deprecated. use SearchMediaQueryConfiguration.search(...)

Search media

Parameters:
text - text to search
type - if specified restricts the search to the type
Returns:
found medias
Throws:
javax.jcr.RepositoryException - exception working on repository

find

@Deprecated
public Collection<info.magnolia.cms.core.Content> find(String path,
                                                                  String type,
                                                                  String search,
                                                                  boolean recursive)
                                                throws javax.jcr.RepositoryException
Deprecated. use the find method overload based on Magnolia Criteria API

Parameters:
path -
type -
search -
recursive -
Returns:
Throws:
javax.jcr.RepositoryException

getMediaTypeConfigurationFromMedia

public MediaTypeConfiguration getMediaTypeConfigurationFromMedia(info.magnolia.cms.core.Content media)
Get the type configuration for a media

Parameters:
media - media
Returns:
type configuration

getURIMappingPrefix

public String getURIMappingPrefix()
Get uri mapping for repo

Returns:
uri mapping for repo


Copyright © 2008-2011 Openmind. All Rights Reserved.