|
Dekoh platform API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdekoh.portal.fwk.importer.AbstractImportProcessor
public abstract class AbstractImportProcessor
Content application that intend to manage digital assets that are represented as files (like JPG, mp3, mov) can extend this class to import the metadata into Dekoh Database.
| Field Summary | |
|---|---|
protected String |
applicationAutoImportProperty
|
protected String |
applicationContextPath
|
protected DIOEntityManager |
em
|
protected LocalUser |
owner
|
| Constructor Summary | |
|---|---|
protected |
AbstractImportProcessor(DIOEntityManagerFactory dioemf,
String contextpath,
String autoImportLocationProperty)
|
protected |
AbstractImportProcessor(LocalRequestContext localRequestContext,
String contextpath,
String autoImportLocationProperty)
|
| Method Summary | |
|---|---|
protected void |
addToMyCollection(DioCollection rootCollection)
|
void |
beginImport()
Marks the begin for batched commit of files to Dekoh. |
void |
close()
Close Resources (if any) used by processor. |
void |
commitChanges()
Commit all the changes that have been batched since last ImportProcessor.beginImport() callback. |
protected DioCollection |
createAndPersistNewCollection(File collectionDir,
String collectionName,
LocalUser owner)
|
protected DioCollection |
createAndPersistNewCollection(RootFolder root,
File collectionDir,
String collectionName)
|
protected void |
createPath(File dir,
DioCollection collection,
RootFolder rootFolder)
|
protected abstract List |
findAllByFileAndSourceDir(File file,
Directory sourceDir)
|
protected DioCollection |
findAlreadyPersistedCollection(String autoImportLocation,
RootFolder rootFolder)
|
protected abstract DigitalObject |
findByFileAndSourceDir(File file,
Directory sourceDir)
|
static DioCollection |
findCollectionAutoImportProperty(DIOEntityManager em,
String applicationAutoImportProperty,
String autoImportLocation)
|
static DioCollection |
findCollectionAutoImportProperty(DIOEntityManager em,
String applicationAutoImportProperty,
String autoImportLocation,
LocalUser owner)
|
List |
findFilesThatAreRemovedFromFileSystem(File dir)
Arranges the newly Imported Collection and clears the local cache |
protected String |
getAutoImportPath(File dir)
|
protected DioCollection |
getOrCreateCollection(RootFolder root,
File dir,
String collectionName)
|
protected abstract File |
getSourceFile(DigitalObject digitalObject)
Used to find the files on disk that are removed, for which Digital objects still exist. |
ImportStatusInfo |
importDigitalObject(ImportRequest importRequest)
|
protected ImportStatusInfo |
importDirectory(RootFolder root,
File dir,
String collectionName)
|
boolean |
isNewDirectory(File directory,
RootFolder rootFolder)
ImportService will use this method to check if Dekoh Database has DigitialObject representations of Files that are removed from filesystem. |
protected boolean |
isParentDirImportedInThisImportContext(File parentDir)
|
protected Directory |
lookupDirectoryEntity(File parentDir)
Opmization to exploit depth first search the ImportService is most likely to employ when emitting events. |
ImportStatusInfo |
removeFileFromDB(File removedFile)
Remove the digitalObject for this file from Dekoh. |
void |
rollback()
Rollback if there is an active transaction started by ImportProcessor.beginImport() |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface dekoh.portal.fwk.importer.ImportProcessor |
|---|
importDigitalObject, importDigitalObject |
| Field Detail |
|---|
protected DIOEntityManager em
protected String applicationContextPath
protected final String applicationAutoImportProperty
protected LocalUser owner
| Constructor Detail |
|---|
protected AbstractImportProcessor(LocalRequestContext localRequestContext,
String contextpath,
String autoImportLocationProperty)
protected AbstractImportProcessor(DIOEntityManagerFactory dioemf,
String contextpath,
String autoImportLocationProperty)
| Method Detail |
|---|
public ImportStatusInfo importDigitalObject(ImportRequest importRequest)
importDigitalObject in interface ImportProcessor
public boolean isNewDirectory(File directory,
RootFolder rootFolder)
ImportProcessorImportedDirectories.getDirectoryStatus(java.io.File,RootFolder)}
cannot determine the state of a directory.
isNewDirectory in interface ImportProcessorImportProcessor.findFilesThatAreRemovedFromFileSystem(java.io.File)
protected DioCollection findAlreadyPersistedCollection(String autoImportLocation,
RootFolder rootFolder)
autoImportLocation - rootFolder -
public static DioCollection findCollectionAutoImportProperty(DIOEntityManager em,
String applicationAutoImportProperty,
String autoImportLocation)
public static DioCollection findCollectionAutoImportProperty(DIOEntityManager em,
String applicationAutoImportProperty,
String autoImportLocation,
LocalUser owner)
protected boolean isParentDirImportedInThisImportContext(File parentDir)
protected ImportStatusInfo importDirectory(RootFolder root,
File dir,
String collectionName)
protected void createPath(File dir,
DioCollection collection,
RootFolder rootFolder)
protected Directory lookupDirectoryEntity(File parentDir)
parentDir - looking for this one..
public void commitChanges()
ImportProcessorImportProcessor.beginImport() callback. Batching of commits is
required to control heap usage by the created but yet to be persisted DigitalObjects
commitChanges in interface ImportProcessordekoh.portal.fwk.persistence.DIOEntityManager#commitTx()}public void beginImport()
ImportProcessorpre-set limit is reached while importing files
in a directory.
Implementations are expected to start a new Transaction when this method is called.
beginImport in interface ImportProcessorImportProcessor.commitChanges(),
ImportProcessor.isNewDirectory(java.io.File,RootFolder),
ImportConfig.getNumberOfFilesInBatch(),
dekoh.portal.fwk.persistence.DIOEntityManagerFactory#createDIOEntityManager()}public void rollback()
ImportProcessorImportProcessor.beginImport()
rollback in interface ImportProcessorpublic void close()
ImportProcessor
close in interface ImportProcessor
protected DioCollection getOrCreateCollection(RootFolder root,
File dir,
String collectionName)
protected String getAutoImportPath(File dir)
protected DioCollection createAndPersistNewCollection(File collectionDir,
String collectionName,
LocalUser owner)
protected DioCollection createAndPersistNewCollection(RootFolder root,
File collectionDir,
String collectionName)
protected void addToMyCollection(DioCollection rootCollection)
public List findFilesThatAreRemovedFromFileSystem(File dir)
findFilesThatAreRemovedFromFileSystem in interface ImportProcessorprotected abstract File getSourceFile(DigitalObject digitalObject)
digitalObject - represents a file, because files from User's desktop are being imported.
public ImportStatusInfo removeFileFromDB(File removedFile)
ImportProcessorImportProcessor.findFilesThatAreRemovedFromFileSystem(java.io.File), other cases when this mehtod may be called is when user
triggers deletion.
removeFileFromDB in interface ImportProcessor
protected abstract DigitalObject findByFileAndSourceDir(File file,
Directory sourceDir)
protected abstract List findAllByFileAndSourceDir(File file,
Directory sourceDir)
|
Dekoh platform API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
© 2009 Pramati Technologies - Dekoh - Portal for Developers