|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object magoffin.matt.ma2.biz.impl.IOBizImpl
public class IOBizImpl
Implementation of IOBiz.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface magoffin.matt.ma2.biz.IOBiz |
---|
IOBiz.TwoPhaseExportRequest |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_ZIP_MIME_TYPE
The default property for the getZipMimeType() property. |
Fields inherited from interface magoffin.matt.ma2.biz.IOBiz |
---|
IMPORT_MEDIA_XML_METADATA_NAME |
Constructor Summary | |
---|---|
IOBizImpl()
|
Method Summary | |
---|---|
int |
clearCacheFiles(User user,
java.util.Set<MediaSize> ofSize)
Clear all cache files for a particular user, optionally of a particular size only. |
int |
deleteMedia(java.util.List<MediaItem> itemsToDelete)
Delete media item files. |
WorkBiz.WorkInfo |
exportItems(ExportItemsCommand command,
MediaRequest request,
MediaResponse response,
BizContext context)
Export a set of media items as a Zip archive. |
WorkBiz.WorkInfo |
exportMedia(MediaRequest request,
MediaResponse response,
BizContext context)
Export media from the application. |
void |
finish()
Call to clean up resources as necessary. |
AlbumDao |
getAlbumDao()
|
CollectionDao |
getCollectionDao()
|
DomainObjectFactory |
getDomainObjectFactory()
|
javax.activation.FileTypeMap |
getFileTypeMap()
|
MediaBiz |
getMediaBiz()
|
MediaItemDao |
getMediaItemDao()
|
org.springframework.context.MessageSource |
getMessages()
|
org.springframework.core.io.Resource |
getMetadataSchemaResource()
|
SystemBiz |
getSystemBiz()
|
WorkBiz |
getWorkBiz()
|
magoffin.matt.util.ThreadSafeDateFormat |
getXmlDateFormat()
|
magoffin.matt.util.ThreadSafeDateFormat |
getXmlDateTimeFormat()
|
XmlHelper |
getXmlHelper()
|
java.util.Set<java.lang.String> |
getZipContentTypes()
|
java.util.List<java.lang.String> |
getZipIgnorePatterns()
|
java.lang.String |
getZipMimeType()
|
WorkBiz.WorkInfo |
importMedia(AddMediaCommand command,
BizContext context)
Import media into the application. |
void |
init()
Call to initialize after peroprties have been set. |
int |
moveMedia(java.util.List<MediaItem> itemsToMove,
Collection toCollection)
Move media item files to a new directory. |
void |
setAlbumDao(AlbumDao albumDao)
|
void |
setCollectionDao(CollectionDao collectionDao)
|
void |
setDomainObjectFactory(DomainObjectFactory domainObjectFactory)
|
void |
setFileTypeMap(javax.activation.FileTypeMap fileTypeMap)
|
void |
setMediaBiz(MediaBiz mediaBiz)
|
void |
setMediaItemDao(MediaItemDao mediaItemDao)
|
void |
setMessages(org.springframework.context.MessageSource messages)
|
void |
setMetadataSchemaResource(org.springframework.core.io.Resource metadataSchemaResource)
|
void |
setSystemBiz(SystemBiz systemBiz)
|
void |
setWorkBiz(WorkBiz workBiz)
|
void |
setXmlDateFormat(magoffin.matt.util.ThreadSafeDateFormat xmlDateFormat)
|
void |
setXmlDateTimeFormat(magoffin.matt.util.ThreadSafeDateFormat xmlDateTimeFormat)
|
void |
setXmlHelper(XmlHelper xmlHelper)
|
void |
setZipContentTypes(java.util.Set<java.lang.String> zipContentTypes)
|
void |
setZipIgnorePatterns(java.util.List<java.lang.String> zipIgnorePatterns)
|
void |
setZipMimeType(java.lang.String zipMimeType)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_ZIP_MIME_TYPE
getZipMimeType()
property.
Constructor Detail |
---|
public IOBizImpl()
Method Detail |
---|
public void init()
public void finish()
public WorkBiz.WorkInfo importMedia(AddMediaCommand command, BizContext context)
IOBiz
This method is designed to allow for imports that take
some time to run, and thus should happen asynchronously. Thus
a WorkInfo
object is returned, which will give
details of the status of the import job. The
WorkBiz.getInfo(long)
method can be used to query the
status of the job at a later point, using the ticket returned
by WorkBiz.WorkInfo.getTicket()
.
importMedia
in interface IOBiz
command
- the media to importcontext
- the biz context
public int deleteMedia(java.util.List<MediaItem> itemsToDelete)
IOBiz
This method deletes the files associated with the MediaItem instances, but does not delete the MediaItem instances from the backend database. It should also clean up any cache files for the associated items.
deleteMedia
in interface IOBiz
itemsToDelete
- the items to delete
public int moveMedia(java.util.List<MediaItem> itemsToMove, Collection toCollection)
IOBiz
moveMedia
in interface IOBiz
itemsToMove
- the items to movetoCollection
- the Collection to move them to
public WorkBiz.WorkInfo exportMedia(MediaRequest request, MediaResponse response, BizContext context)
IOBiz
exportMedia
in interface IOBiz
request
- the requestresponse
- the responsecontext
- the biz context
public WorkBiz.WorkInfo exportItems(ExportItemsCommand command, MediaRequest request, MediaResponse response, BizContext context)
IOBiz
If ExportItemsCommand.getAlbumId()
or
ExportItemsCommand.getAlbumKey()
is non-null, then this will
export all the items of that album into a zip archive. Otherwise
it will export all the items specified by
ExportItemsCommand.getItemIds()
. The quality
and
size
parameters are not used, it will instead rely on
the setting in the MediaRequest
.
This method should support two-phase procesing if the
MediaResponse
is null. The method should return a
WorkInfo
as normal but the WorkRequest
returned by
WorkBiz.WorkInfo.getWorkRequest()
must implement IOBiz.TwoPhaseExportRequest
.
The work to export the items should not begin until a later time when
IOBiz.TwoPhaseExportRequest.setMediaResponse(MediaResponse)
is called. The implementation must wait only for a finite amount
of time for setMediaResponse
to be called, after which time
the job can be discarded.
This is to allow for flexibility with the calling applicaiton GUI where the work ticket is needed before the actual OutputStream is ready for the exported items.
exportItems
in interface IOBiz
command
- the export commandrequest
- the request (for all media in the album)response
- the responsecontext
- the context
public int clearCacheFiles(User user, java.util.Set<MediaSize> ofSize)
IOBiz
clearCacheFiles
in interface IOBiz
user
- the user to clear cache files forofSize
- if specified, a set of sizes to clear
public java.util.List<java.lang.String> getZipIgnorePatterns()
public void setZipIgnorePatterns(java.util.List<java.lang.String> zipIgnorePatterns)
zipIgnorePatterns
- the zipIgnorePatterns to setpublic CollectionDao getCollectionDao()
public void setCollectionDao(CollectionDao collectionDao)
collectionDao
- The collectionDao to set.public MediaBiz getMediaBiz()
public void setMediaBiz(MediaBiz mediaBiz)
mediaBiz
- The mediaBiz to set.public MediaItemDao getMediaItemDao()
public void setMediaItemDao(MediaItemDao mediaItemDao)
mediaItemDao
- The mediaItemDao to set.public org.springframework.context.MessageSource getMessages()
public void setMessages(org.springframework.context.MessageSource messages)
messages
- The messages to set.public WorkBiz getWorkBiz()
public void setWorkBiz(WorkBiz workBiz)
workBiz
- The workBiz to set.public java.util.Set<java.lang.String> getZipContentTypes()
public void setZipContentTypes(java.util.Set<java.lang.String> zipContentTypes)
zipContentTypes
- The zipContentTypes to set.public SystemBiz getSystemBiz()
public void setSystemBiz(SystemBiz systemBiz)
systemBiz
- The systemBiz to set.public javax.activation.FileTypeMap getFileTypeMap()
public void setFileTypeMap(javax.activation.FileTypeMap fileTypeMap)
fileTypeMap
- the fileTypeMap to setpublic AlbumDao getAlbumDao()
public void setAlbumDao(AlbumDao albumDao)
albumDao
- the albumDao to setpublic DomainObjectFactory getDomainObjectFactory()
public void setDomainObjectFactory(DomainObjectFactory domainObjectFactory)
domainObjectFactory
- the domainObjectFactory to setpublic XmlHelper getXmlHelper()
public void setXmlHelper(XmlHelper xmlHelper)
xmlHelper
- the xmlHelper to setpublic org.springframework.core.io.Resource getMetadataSchemaResource()
public void setMetadataSchemaResource(org.springframework.core.io.Resource metadataSchemaResource)
metadataSchemaResource
- the metadataSchemaResource to setpublic magoffin.matt.util.ThreadSafeDateFormat getXmlDateFormat()
public void setXmlDateFormat(magoffin.matt.util.ThreadSafeDateFormat xmlDateFormat)
xmlDateFormat
- the xmlDateFormat to setpublic magoffin.matt.util.ThreadSafeDateFormat getXmlDateTimeFormat()
public void setXmlDateTimeFormat(magoffin.matt.util.ThreadSafeDateFormat xmlDateTimeFormat)
xmlDateTimeFormat
- the xmlDateTimeFormat to setpublic java.lang.String getZipMimeType()
public void setZipMimeType(java.lang.String zipMimeType)
zipMimeType
- the zipMimeType to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |