|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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.parseme
ignore.processme
process.parseme
process.processme
exception.parseme
exception.processme
exception-long.parseme
exception-long.processme
partially-blacklist-exception.parseme
partially-blacklist-exception.processme
globally-blacklist-exception.parseme
globally-blacklist-exception.processme
unknown-exception.parseme
unknown-exception.processme
processerror-parsesuccess.processandparseme
processsuccess-parseerror.processandparseme
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.jalios.jcms.fileprocessor.FileActionComponent |
---|
FileActionComponent.Operation |
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_OPERATION, FILE_SEPARATOR, REVISION |
Fields inherited from interface com.jalios.jcms.fileprocessor.FileActionComponent |
---|
CURRENT_OPERATION, FILE_SEPARATOR, 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 FileActionComponent
public String getDescription()
FileActionComponent
getDescription
in interface FileActionComponent
public boolean process(File file, Map<String,Object> ctxt) throws ProcessingException
FileProcessor
process
in interface FileProcessor
file
- 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 FileParser
file
- 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 FileActionComponent
public boolean isAvailable()
FileActionComponent
isAvailable
in interface FileActionComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |