|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.datacrow.fileimporters.FileImporter
public abstract class FileImporter
Base for all file importers. A file importer is capable of scanning a specific
location for specific file types. These files are parsed and their information
is stored in a DcObject
.
Constructor Summary | |
---|---|
FileImporter(int module)
Creates a new instance. |
Method Summary | |
---|---|
void |
addMessage(java.lang.String message)
|
protected void |
afterImport()
Called after finishing the whole parsing process. |
protected void |
afterParse(DcObject dco)
Called after parsing a single file. |
boolean |
allowDirectoryRegistration()
Indicates if a directory can be used instead of a file. |
boolean |
allowReparsing()
Indicates if files can be parsed again. |
void |
beforeParse()
To be executed before a file is parsed. |
boolean |
canImportArt()
Indicates if local art can be used. |
void |
enableActions(boolean b)
|
IFileImportClient |
getClient()
|
abstract java.lang.String[] |
getDefaultSupportedFileTypes()
|
int |
getItemPickMode()
|
int |
getModule()
The module to which this importer belongs. |
protected java.lang.String |
getName(java.lang.String file,
int directoryUsage)
Tries to create a name from the specified file. |
Region |
getRegion()
|
SearchMode |
getSearchMode()
|
IServer |
getServer()
|
java.lang.String[] |
getSupportedFileTypes()
|
void |
initialize()
|
void |
initProgressBar(int max)
|
boolean |
isCancelled()
|
boolean |
isReparseFiles()
|
void |
parse(java.util.Collection<java.lang.String> sources)
Starts the parsing task. |
protected void |
parse(java.lang.String filename)
Parses a single file. |
abstract DcObject |
parse(java.lang.String filename,
int directoryUsage)
Parses a file and extracts its information. |
void |
setClient(IFileImportClient client)
|
protected void |
setImages(java.lang.String filename,
DcObject dco,
int front,
int back,
int cd)
Retrieve and use local art. |
void |
showUI()
Opens the importer dialog. |
void |
updateProgressBar()
|
boolean |
useOnlineService()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileImporter(int module)
module
- The module to which this importer belongs.Method Detail |
---|
public void setClient(IFileImportClient client)
public IFileImportClient getClient()
public int getModule()
public void showUI()
FileImportDialog
public abstract DcObject parse(java.lang.String filename, int directoryUsage)
filename
- The file to check.directoryUsage
- A free interpretation of the directory usage.
Depends on a specific implementation.
ParseException
public abstract java.lang.String[] getDefaultSupportedFileTypes()
public java.lang.String[] getSupportedFileTypes()
public boolean allowDirectoryRegistration()
public boolean allowReparsing()
public boolean canImportArt()
public void beforeParse()
public void parse(java.util.Collection<java.lang.String> sources) throws java.lang.Exception
sources
- The files to check.
java.lang.Exception
protected void parse(java.lang.String filename)
listener
- filename
- protected void afterImport()
protected void afterParse(DcObject dco)
listener
- dco
- protected java.lang.String getName(java.lang.String file, int directoryUsage)
file
- directoryUsage
- Either 1 (to use directory information) or 0.
protected void setImages(java.lang.String filename, DcObject dco, int front, int back, int cd)
filename
- The file location for which art will be retrieved.dco
- front
- The front image field index.back
- The back image field index.cd
- The media image field index.DcRepository.ModuleSettings#stImportLocalArt
,
DcRepository.ModuleSettings#stImportLocalArtRecurse
,
DcRepository.ModuleSettings#stImportLocalArtFrontKeywords
,
DcRepository.ModuleSettings#stImportLocalArtBackKeywords
,
DcRepository.ModuleSettings#stImportLocalArtMediaKeywords
public void addMessage(java.lang.String message)
addMessage
in interface ISynchronizerClient
public void enableActions(boolean b)
enableActions
in interface ISynchronizerClient
public int getItemPickMode()
getItemPickMode
in interface ISynchronizerClient
public Region getRegion()
getRegion
in interface ISynchronizerClient
public SearchMode getSearchMode()
getSearchMode
in interface ISynchronizerClient
public IServer getServer()
getServer
in interface ISynchronizerClient
public void initialize()
initialize
in interface ISynchronizerClient
public void initProgressBar(int max)
initProgressBar
in interface ISynchronizerClient
public boolean isCancelled()
isCancelled
in interface ISynchronizerClient
public boolean isReparseFiles()
isReparseFiles
in interface ISynchronizerClient
public void updateProgressBar()
updateProgressBar
in interface ISynchronizerClient
public boolean useOnlineService()
useOnlineService
in interface ISynchronizerClient
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |