Class MimetypesGet
- java.lang.Object
-
- org.springframework.extensions.webscripts.AbstractWebScript
-
- org.springframework.extensions.webscripts.DeclarativeWebScript
-
- org.alfresco.repo.web.scripts.content.MimetypesGet
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.extensions.webscripts.WebScript
public class MimetypesGet extends org.springframework.extensions.webscripts.DeclarativeWebScript implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
Lists mimetypes, and optionally their associated content transformers and metadata extractors.- Since:
- 3.4.b
- Author:
- Nick Burch
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
JOD_WORKER_BEAN
static java.lang.String
MODEL_EXTENSIONS
static java.lang.String
MODEL_MIMETYPE_DETAILS
static java.lang.String
MODEL_MIMETYPES
protected static java.lang.String
PROXY_LABEL_DEFAULT_MESSAGE
protected static java.lang.String
RTS_WORKER_BEAN
-
Constructor Summary
Constructors Constructor Description MimetypesGet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
protected java.util.Map<java.lang.String,java.lang.Object>
executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
protected java.lang.String
getComplexTransformerLabel(org.alfresco.repo.content.transform.ComplexContentTransformer cct)
Gets the display label for complex transformersprotected java.util.List<java.lang.String>
getExtractors(java.lang.String mimetype)
protected java.lang.String
getProxyTransformerLabel(org.alfresco.repo.content.transform.ProxyContentTransformer pct)
Gets the display label for proxy content transformersprotected java.lang.String
getTransformer(java.lang.String from, long sourceSize, java.lang.String to)
Note - for now, only does the best one, not allprotected java.util.List<java.lang.String>
getTransformersFrom(java.lang.String mimetype, long sourceSize, java.util.List<java.lang.String> allMimetypes)
protected java.util.List<java.lang.String>
getTransformersTo(java.lang.String mimetype, long sourceSize, java.util.List<java.lang.String> allMimetypes)
protected java.lang.String
getWorkerBeanName(org.alfresco.repo.content.transform.ContentTransformerWorker ctw)
Gets the given ContentTransformerWorker's bean name from the cache of known workersvoid
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Uses the context to find OpenOffice related beans.void
setContentTransformerRegistry(org.alfresco.repo.content.transform.ContentTransformerRegistry contentTransformerRegistry)
Sets the Content Transformer Registry to be used to decide what transformations existvoid
setKnownWorkerBeanLabels(java.util.Map<java.lang.String,java.lang.String> knownWorkerBeanLabels)
Sets the map of content transformer worker bean names to message formatting labelsvoid
setMetadataExtracterRegistry(org.alfresco.repo.content.metadata.MetadataExtracterRegistry metadataExtracterRegistry)
Sets the Metadata Extractor Registry to be used to decide what extractors existvoid
setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
Sets the Mimetype Service to be used to get the list of mime types-
Methods inherited from class org.springframework.extensions.webscripts.DeclarativeWebScript
execute, executeFinallyImpl, executeImpl, executeImpl, getTemplateModel, renderFormatTemplate
-
Methods inherited from class org.springframework.extensions.webscripts.AbstractWebScript
addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
-
-
-
-
Field Detail
-
MODEL_MIMETYPES
public static final java.lang.String MODEL_MIMETYPES
- See Also:
- Constant Field Values
-
MODEL_EXTENSIONS
public static final java.lang.String MODEL_EXTENSIONS
- See Also:
- Constant Field Values
-
MODEL_MIMETYPE_DETAILS
public static final java.lang.String MODEL_MIMETYPE_DETAILS
- See Also:
- Constant Field Values
-
JOD_WORKER_BEAN
protected static final java.lang.String JOD_WORKER_BEAN
- See Also:
- Constant Field Values
-
RTS_WORKER_BEAN
protected static final java.lang.String RTS_WORKER_BEAN
- See Also:
- Constant Field Values
-
PROXY_LABEL_DEFAULT_MESSAGE
protected static final java.lang.String PROXY_LABEL_DEFAULT_MESSAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
Uses the context to find OpenOffice related beans. Allows us to work more cleanly on Community and Enterprise- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
-
setMimetypeService
public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
Sets the Mimetype Service to be used to get the list of mime types
-
setContentTransformerRegistry
public void setContentTransformerRegistry(org.alfresco.repo.content.transform.ContentTransformerRegistry contentTransformerRegistry)
Sets the Content Transformer Registry to be used to decide what transformations exist
-
setMetadataExtracterRegistry
public void setMetadataExtracterRegistry(org.alfresco.repo.content.metadata.MetadataExtracterRegistry metadataExtracterRegistry)
Sets the Metadata Extractor Registry to be used to decide what extractors exist
-
setKnownWorkerBeanLabels
public void setKnownWorkerBeanLabels(java.util.Map<java.lang.String,java.lang.String> knownWorkerBeanLabels)
Sets the map of content transformer worker bean names to message formatting labels
-
executeImpl
protected java.util.Map<java.lang.String,java.lang.Object> executeImpl(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.Status status, org.springframework.extensions.webscripts.Cache cache)
- Overrides:
executeImpl
in classorg.springframework.extensions.webscripts.DeclarativeWebScript
-
getExtractors
protected java.util.List<java.lang.String> getExtractors(java.lang.String mimetype)
-
getTransformersFrom
protected java.util.List<java.lang.String> getTransformersFrom(java.lang.String mimetype, long sourceSize, java.util.List<java.lang.String> allMimetypes)
-
getTransformersTo
protected java.util.List<java.lang.String> getTransformersTo(java.lang.String mimetype, long sourceSize, java.util.List<java.lang.String> allMimetypes)
-
getTransformer
protected java.lang.String getTransformer(java.lang.String from, long sourceSize, java.lang.String to)
Note - for now, only does the best one, not all
-
getComplexTransformerLabel
protected java.lang.String getComplexTransformerLabel(org.alfresco.repo.content.transform.ComplexContentTransformer cct)
Gets the display label for complex transformers- Parameters:
cct
- ComplexContentTransformer- Returns:
- the transformer display label
-
getProxyTransformerLabel
protected java.lang.String getProxyTransformerLabel(org.alfresco.repo.content.transform.ProxyContentTransformer pct)
Gets the display label for proxy content transformers- Parameters:
pct
- ProxyContentTransformer- Returns:
- the transformer display label
-
getWorkerBeanName
protected java.lang.String getWorkerBeanName(org.alfresco.repo.content.transform.ContentTransformerWorker ctw)
Gets the given ContentTransformerWorker's bean name from the cache of known workersIn the future ContentTransformerWorker may be made bean name aware.
- Parameters:
ctw
- ContentTransformerWorker- Returns:
- the bean name
-
-