org.alfresco.repo.content.transform
Class OpenOfficeContentTransformerWorker

java.lang.Object
  extended by org.alfresco.repo.content.transform.ContentTransformerHelper
      extended by org.alfresco.repo.content.transform.OOoContentTransformerHelper
          extended by org.alfresco.repo.content.transform.OpenOfficeContentTransformerWorker
All Implemented Interfaces:
ContentTransformerWorker, org.springframework.beans.factory.InitializingBean

public class OpenOfficeContentTransformerWorker
extends OOoContentTransformerHelper
implements ContentTransformerWorker, org.springframework.beans.factory.InitializingBean

Makes use of the http://sourceforge.net/projects/joott/JOOConverter library to perform OpenOffice-driven conversions. This requires that OpenOffice be running, but delivers a wider range of transformations than Tika is able to (Tika just translates into Text, HTML and XML)


Constructor Summary
OpenOfficeContentTransformerWorker()
           
 
Method Summary
 void afterPropertiesSet()
           
 java.lang.String getVersionString()
          Gets a string returning product and version information.
 boolean isAvailable()
          Checks if this worker is available.
 boolean isTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
           
 void setConnection(net.sf.jooreports.openoffice.connection.OpenOfficeConnection connection)
           
 void setConverter(net.sf.jooreports.openoffice.converter.AbstractOpenOfficeDocumentConverter converter)
          Explicitly set the converter to be used.
 void setDocumentFormatsConfiguration(java.lang.String path)
          Set a non-default location from which to load the document format mappings.
 void transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options)
           
 
Methods inherited from class org.alfresco.repo.content.transform.OOoContentTransformerHelper
isTransformationBlocked
 
Methods inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper
getMimetype, getMimetypeService, isExplicitTransformation, setExplicitTransformations, setMimetypeService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenOfficeContentTransformerWorker

public OpenOfficeContentTransformerWorker()
Method Detail

setConnection

public void setConnection(net.sf.jooreports.openoffice.connection.OpenOfficeConnection connection)
Parameters:
connection - the connection that the converter uses

setConverter

public void setConverter(net.sf.jooreports.openoffice.converter.AbstractOpenOfficeDocumentConverter converter)
Explicitly set the converter to be used. The converter must use the same connection set in OpenOfficeContentTransformerWorker.setConnection(OpenOfficeConnection).

If not set, then the OpenOfficeDocumentConverter will be used.

Parameters:
converter - the converter to use.

setDocumentFormatsConfiguration

public void setDocumentFormatsConfiguration(java.lang.String path)
Set a non-default location from which to load the document format mappings.

Parameters:
path - a resource location supporting the file: or classpath: prefixes

isAvailable

public boolean isAvailable()
Description copied from interface: ContentTransformerWorker
Checks if this worker is available.

Specified by:
isAvailable in interface ContentTransformerWorker
Returns:
true if it is available

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

isTransformable

public boolean isTransformable(java.lang.String sourceMimetype,
                               java.lang.String targetMimetype,
                               TransformationOptions options)
Specified by:
isTransformable in interface ContentTransformerWorker
See Also:
DocumentFormatRegistry

transform

public void transform(org.alfresco.service.cmr.repository.ContentReader reader,
                      org.alfresco.service.cmr.repository.ContentWriter writer,
                      TransformationOptions options)
               throws java.lang.Exception
Specified by:
transform in interface ContentTransformerWorker
Throws:
java.lang.Exception
See Also:
ContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions)

getVersionString

public java.lang.String getVersionString()
Description copied from interface: ContentTransformerWorker
Gets a string returning product and version information.

Specified by:
getVersionString in interface ContentTransformerWorker
Returns:
the version string


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.