|
Implementations of this service are primarily responsible for ensuring that the correct store is used to access content, and that reads and writes for the same node reference are routed to the same store instance.
The mechanism for selecting an appropriate store is not prescribed by the interface, but typically the decision will be made on the grounds of content type.
Whereas the content stores have no knowledge of nodes other than their
references, the ContentService
is responsible for
ensuring that all the relevant node-content relationships are maintained.
Method Summary | ||
getActiveTransformers(String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options) | ||
getActiveTransformers(String sourceMimetype, String targetMimetype, TransformationOptions options) | ||
getImageTransformer() Fetch the transformer that is capable of transforming image content. |
||
long |
getMaxSourceSizeBytes(String sourceMimetype, String targetMimetype, TransformationOptions options) Returns the maximum source size of any content that may transformed between the supplied mimetypes using the supplied options. |
|
getRawReader(String contentUrl) Fetch content from the low-level stores using a content URL. |
||
getReader(NodeRef nodeRef, QName propertyQName) Gets a reader for the content associated with the given node property. |
||
long |
getStoreFreeSpace() Gets the remaing available space in the underlying content store. |
|
long |
getStoreTotalSpace() Gets the total space of the underlying content store (not exclusively Alfresco-controlled binaries). |
|
getTempWriter() Gets a writer to a temporary location. |
||
getTransformer(String sourceMimetype, String targetMimetype) Fetch the transformer that is capable of transforming the content in the given source mimetype to the given target mimetype. |
||
getTransformer(String sourceUrl, String sourceMimetype, long sourceSize, 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. |
||
getTransformer(String sourceMimetype, String targetMimetype, TransformationOptions options) Deprecated. use overloaded method with sourceSize parameter. |
||
getTransformers(String sourceUrl, String sourceMimetype, long sourceSize, String targetMimetype, TransformationOptions options) Fetch the transformers that are capable of transforming the content in the given source mimetype to the given target mimetype with the provided transformation options. |
||
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. |
||
boolean |
isTransformable(ContentReader reader, ContentWriter 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 |
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, Map<String,Object> options) Deprecated. As of release 3.0 the TransformOptions class should be used to pass transformation options to a transformation execution. |
|
void |
transform(ContentReader reader, ContentWriter writer, TransformationOptions options) |
null is never returned, but the reader should always be checked for existence.
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.
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.
NOTE: The content URL provided will be registered for automatic cleanup in the event that the transaction, in which this method was called, rolls back. If the transaction is successful, the writer may still be open and available for use but the underlying binary will not be cleaned up subsequently. The recommended pattern is to group calls to retrieve the writer in the same transaction as the calls to subsequently update and close the write stream - including setting of the related content properties.The mimetypes used for the transformation must be set both on the reader and on the writer.
Since no transformation options are provided only the source and destination mimetypes are considered when getting the correct transformer.
If you are about to call transform(ContentReader, ContentWriter, TransformationOptions) it is best NOT to call this method first as it must perform the same steps and will throw NoTransformerException if there are no transformers.
The mimetypes used for the transformation must be set both on the reader and on the writer.
|