Book Image

Alfresco Developer Guide

Book Image

Alfresco Developer Guide

Overview of this book

Table of Contents (17 chapters)
Alfresco Developer Guide
Credits
About the Author
About the Reviewers
Preface
Index

Transforming Content from One Format to Another


A content transformer is used to transform content from one format to another. Content transformers are implemented as a Java class configured as a Spring bean. Alfresco finds the appropriate transformer based on source and target MIME type. There are two important use cases for transformers. The first is when an end user triggers a transformation, usually through an action. The most well-known out of the box example is converting Microsoft Office documents to PDF. Other out of the box transformers include:

  • HTML-to-Text (HtmlParserContentTransformer)

  • Microsoft Excel-to-CSV (PoiHssfContentTransformer)

  • Microsoft Word-to-Text (TextMiningContentTransformer)

  • PDF-to-Text (PdfBoxContentTransformer)

See the Appendix for further details on the out of the box transformers.

The second key transformer use case involves the Lucene full-text search engine. Lucene indexes content when it is added to the repository. But it only understands plain text. When a binary...