|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.content.transform.ContentTransformerHelper
org.alfresco.repo.content.transform.AbstractContentTransformer2
org.alfresco.repo.content.transform.PoiHssfContentTransformer
public class PoiHssfContentTransformer
Makes use of the POI
library to
perform conversions from Excel spreadsheets to text (comma separated).
While most text extraction from spreadsheets only extract the first sheet of the workbook, the method used here extracts the text from all the sheets. This is more useful, especially when it comes to indexing spreadsheets.
In the case where there is only one sheet in the document, the results will be exactly the same as most extractors. Where there are multiple sheets, the results will differ, but meaningful reimporting of the text document is not possible anyway.
Field Summary | |
---|---|
static java.lang.String |
WRONG_FORMAT_MESSAGE_ID
Error message to delegate to NodeInfoBean |
Constructor Summary | |
---|---|
PoiHssfContentTransformer()
|
Method Summary | |
---|---|
boolean |
isTransformable(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
Currently the only transformation performed is that of text extraction from XLS documents. |
void |
transformInternal(ContentReader reader,
ContentWriter writer,
TransformationOptions options)
Method to be implemented by subclasses wishing to make use of the common infrastructural code provided by this class. |
static void |
writeString(java.io.OutputStream os,
java.lang.String encoding,
java.lang.String value,
boolean isData)
Writes the given data to the stream using the encoding specified. |
Methods inherited from class org.alfresco.repo.content.transform.AbstractContentTransformer2 |
---|
checkTransformable, getTransformationTime, recordTime, register, setRegistry, toString, transform, transform, transform |
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, wait, wait, wait |
Methods inherited from interface org.alfresco.repo.content.transform.ContentTransformer |
---|
isExplicitTransformation |
Field Detail |
---|
public static final java.lang.String WRONG_FORMAT_MESSAGE_ID
Constructor Detail |
---|
public PoiHssfContentTransformer()
Method Detail |
---|
public boolean isTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
sourceMimetype
- the source mimetypeoptions
- the transformation options
public void transformInternal(ContentReader reader, ContentWriter writer, TransformationOptions options) throws java.lang.Exception
AbstractContentTransformer2
transformInternal
in class AbstractContentTransformer2
reader
- the source of the content to transformwriter
- the target to which to write the transformed contentoptions
- a map of options to use when performing the transformation. The map
will never be null.
java.lang.Exception
- exceptions will be handled by this class - subclasses can throw anythingpublic static void writeString(java.io.OutputStream os, java.lang.String encoding, java.lang.String value, boolean isData) throws java.lang.Exception
The given data string will be escaped appropriately.
os
- the stream to write toencoding
- the encoding to use, or null if the default encoding is acceptablevalue
- the string to writeisData
- true if the value represents a human-readable string, false if the
value represents formatting characters, separating characters, etc.
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |