|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jalios.jcms.fileprocessor.test.SampleProcessor
public class SampleProcessor
Sample FileProcessor and FileParse which can be used for testing.
1. Configure in custom.prop
fileprocessor.repository.JCMSUpload.component.SampleParser.class: com.jalios.jcms.fileprocessor.test.SampleProcessor fileprocessor.repository.JCMSUpload.component.SampleParser.extensions: parseme processme processandparseme2. Upload test file with the following filename to trigger the corresponding behavior :
ignore.parsemeignore.processmeprocess.parsemeprocess.processmeexception.parsemeexception.processmeexception-long.parsemeexception-long.processmepartially-blacklist-exception.parsemepartially-blacklist-exception.processmeglobally-blacklist-exception.parsemeglobally-blacklist-exception.processmeunknown-exception.parsemeunknown-exception.processmeprocesserror-parsesuccess.processandparsemeprocesssuccess-parseerror.processandparseme
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.jalios.jcms.fileprocessor.FileActionComponent |
|---|
FileActionComponent.Operation |
| Field Summary |
|---|
| Fields inherited from interface com.jalios.jcms.fileprocessor.FileActionComponent |
|---|
CURRENT_FILE_DOCUMENT, CURRENT_OPERATION, FILE_SEPARATOR, PROCESSING_TYPE, REVISION |
| Constructor Summary | |
|---|---|
SampleProcessor()
|
|
| Method Summary | |
|---|---|
String |
extractText(File file,
Map<String,Object> ctxt)
Parsers have to implement at least this method which exctract the text from the specified file and returns it. |
String |
getDescription()
More detailed description of the Parser. |
String |
getName()
Name of the Parser. |
int |
getOrder()
Used to schedule the FileProcessors while treating a file. |
boolean |
isAvailable()
A processor or parser may be unavailable (for instance because of a network connection down). |
boolean |
process(File file,
Map<String,Object> ctxt)
Method invoked to process a file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SampleProcessor()
| Method Detail |
|---|
public String getName()
FileActionComponent
getName in interface FileActionComponentpublic String getDescription()
FileActionComponent
getDescription in interface FileActionComponent
public boolean process(File file,
Map<String,Object> ctxt)
throws ProcessingException
FileProcessor
process in interface FileProcessorfile - the file to processctxt - a Map to share informations between processings.
ProcessingException - if the processing operation failed or if the file should be blacklisted (for this or all processors)
public String extractText(File file,
Map<String,Object> ctxt)
throws ProcessingException
FileParser
extractText in interface FileParserfile - the file to parsectxt - a Map to share informations between processings.
ProcessingException - if the text could not be extracted.public int getOrder()
FileActionComponent
getOrder in interface FileActionComponentpublic boolean isAvailable()
FileActionComponent
isAvailable in interface FileActionComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||