|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.content.ContentServiceImpl
public class ContentServiceImpl
Service implementation acting as a level of indirection between the client and the underlying content store.
Note: This class was formerly the RoutingContentService
but the
'routing' functionality has been pushed into the store
implementations.
Constructor Summary | |
---|---|
ContentServiceImpl()
|
Method Summary | |
---|---|
ContentTransformer |
getImageTransformer()
Fetch the transformer that is capable of transforming image content. |
ContentReader |
getRawReader(java.lang.String contentUrl)
Fetch content from the low-level stores using a content URL. |
ContentReader |
getReader(NodeRef nodeRef,
QName propertyQName)
Gets a reader for the content associated with the given node property. |
ContentWriter |
getTempWriter()
Gets a writer to a temporary location. |
ContentTransformer |
getTransformer(java.lang.String sourceMimetype,
java.lang.String targetMimetype)
Fetch the transformer that is capable of transforming the content in the given source mimetype to the given target mimetype. |
ContentTransformer |
getTransformer(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
Fetch the transformer that is capable of transforming the content in the given source mimetype to the given target mimetype with the provided transformation options. |
ContentWriter |
getWriter(NodeRef nodeRef,
QName propertyQName,
boolean update)
Get a content writer for the given node property, choosing to optionally have the node property updated automatically when the content stream closes. |
void |
init()
Service initialise |
boolean |
isTransformable(ContentReader reader,
ContentWriter writer)
Returns whether a transformer exists that can read the content from the reader and write the content back out to the writer. |
boolean |
isTransformable(ContentReader reader,
ContentWriter writer,
TransformationOptions options)
Returns whether a transformer exists that can read the content from the reader and write the content back out to the writer with the provided tranformation options. |
void |
onUpdateProperties(NodeRef nodeRef,
java.util.Map before,
java.util.Map after)
Update properties policy behaviour |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
Sets the application event publisher. |
void |
setAvmService(AVMService service)
|
void |
setDictionaryService(DictionaryService dictionaryService)
|
void |
setEagerContentStoreCleaner(EagerContentStoreCleaner eagerContentStoreCleaner)
|
void |
setImageMagickContentTransformer(ContentTransformer imageMagickContentTransformer)
|
void |
setNodeService(NodeService nodeService)
|
void |
setPolicyComponent(PolicyComponent policyComponent)
|
void |
setRetryingTransactionHelper(RetryingTransactionHelper helper)
|
void |
setStore(ContentStore store)
|
void |
setTransformerRegistry(ContentTransformerRegistry transformerRegistry)
|
void |
transform(ContentReader reader,
ContentWriter writer)
Transforms the content from the reader and writes the content back out to the writer. |
void |
transform(ContentReader reader,
ContentWriter writer,
java.util.Map options)
Deprecated. |
void |
transform(ContentReader reader,
ContentWriter writer,
TransformationOptions options)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContentServiceImpl()
Method Detail |
---|
public void setRetryingTransactionHelper(RetryingTransactionHelper helper)
public void setDictionaryService(DictionaryService dictionaryService)
public void setNodeService(NodeService nodeService)
public void setTransformerRegistry(ContentTransformerRegistry transformerRegistry)
public void setEagerContentStoreCleaner(EagerContentStoreCleaner eagerContentStoreCleaner)
public void setStore(ContentStore store)
public void setPolicyComponent(PolicyComponent policyComponent)
public void setAvmService(AVMService service)
public void setImageMagickContentTransformer(ContentTransformer imageMagickContentTransformer)
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
applicationEventPublisher
- the new application event publisherpublic void init()
public void onUpdateProperties(NodeRef nodeRef, java.util.Map before, java.util.Map after)
nodeRef
- the node referencebefore
- the before values of the propertiesafter
- the after values of the propertiespublic ContentReader getRawReader(java.lang.String contentUrl)
null is never returned, but the reader should always be checked for
existence
.
getRawReader
in interface ContentService
contentUrl
- a content store URL
public ContentReader getReader(NodeRef nodeRef, QName propertyQName)
ContentService
If a content URL is present for the given node then a reader must
be returned. The exists
method should then
be used to detect 'missing' content.
getReader
in interface ContentService
nodeRef
- a reference to a node having a content propertypropertyQName
- the name of the property, which must be of type content
FileContentReader.getSafeContentReader(ContentReader, String, Object[])
public ContentWriter getWriter(NodeRef nodeRef, QName propertyQName, boolean update)
ContentService
If the update flag is off, then the state of the node property will remain unchanged regardless of the state of the written binary data. If the flag is on, then the node property will be updated on the same thread as the code that closed the write channel.
If no node is supplied, then the writer will provide a stream into the backing content store, but will not be associated with any new or previous content.
getWriter
in interface ContentService
nodeRef
- a reference to a node having a content property, or null
to just get a valid writer into a backing content store.propertyQName
- the name of the property, which must be of type contentupdate
- true if the property must be updated atomically when the content write
stream is closed (attaches a listener to the stream); false if the client code
will perform the updates itself.
public ContentWriter getTempWriter()
ContentService
getTempWriter
in interface ContentService
public void transform(ContentReader reader, ContentWriter writer)
ContentService
The mimetypes used for the transformation must be set both on
the reader
and on the
writer
.
transform
in interface ContentService
reader
- the source content location and mimetypewriter
- the target content location and mimetypeContentTransformerRegistry
,
ContentTransformer
,
ContentService.transform(org.alfresco.service.cmr.repository.ContentReader, org.alfresco.service.cmr.repository.ContentWriter)
public void transform(ContentReader reader, ContentWriter writer, java.util.Map options) throws NoTransformerException, ContentIOException
transform
in interface ContentService
reader
- the source content location and mimetypewriter
- the target content location and mimetypeoptions
- the options for the transformation
NoTransformerException
- if no transformer exists for the
given source and target mimetypes of the reader and writer
ContentIOException
- if the transformation failsContentTransformerRegistry
,
ContentTransformer
public void transform(ContentReader reader, ContentWriter writer, TransformationOptions options) throws NoTransformerException, ContentIOException
transform
in interface ContentService
reader
- the source content location and mimetypewriter
- the target content location and mimetypeoptions
- the options for the transformation
NoTransformerException
- if no transformer exists for the
given source and target mimetypes of the reader and writer
ContentIOException
- if the transformation failsContentTransformerRegistry
,
ContentTransformer
public ContentTransformer getTransformer(java.lang.String sourceMimetype, java.lang.String targetMimetype)
ContentService
Since no transformation options are provided only the source and destination mimetypes are considered when getting the correct transformer.
getTransformer
in interface ContentService
ContentTransformerRegistry
,
ContentTransformer
public ContentTransformer getTransformer(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
ContentService
The transformation options provide a finer grain way of discoving the correct transformer, since the values and type of the options provided are considered by the transformer when deciding whether it can satisfy the transformation request.
getTransformer
in interface ContentService
sourceMimetype
- the source mimetypetargetMimetype
- the target mimetypeoptions
- the transformation options
ContentService.getTransformer(java.lang.String, java.lang.String, org.alfresco.service.cmr.repository.TransformationOptions)
public ContentTransformer getImageTransformer()
ContentService
getImageTransformer
in interface ContentService
ContentService.getImageTransformer()
public boolean isTransformable(ContentReader reader, ContentWriter writer)
ContentService
Since no transformation options are specified, only the source and target mimetypes will be considered when making this decision.
The mimetypes used for the transformation must be set both on
the reader
and on the
writer
.
isTransformable
in interface ContentService
reader
- the source content location and mimetypewriter
- the target content location and mimetype
ContentTransformerRegistry
,
ContentTransformer
public boolean isTransformable(ContentReader reader, ContentWriter writer, TransformationOptions options)
ContentService
The mimetypes used for the transformation must be set both on
the reader
and on the
writer
.
isTransformable
in interface ContentService
reader
- the source content location and mimetypewriter
- the target content location and mimetypeoptions
- the transformation options
ContentService.isTransformable(org.alfresco.service.cmr.repository.ContentReader, org.alfresco.service.cmr.repository.ContentWriter, org.alfresco.service.cmr.repository.TransformationOptions)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |