Class AttachmentService
java.lang.Object
org.jasig.portlet.attachment.service.impl.AttachmentService
- All Implemented Interfaces:
IAttachmentService
@Component public class AttachmentService extends Object implements IAttachmentService
- Author:
- Chris Waymire (chris@waymire.net)
-
Constructor Summary
Constructors Constructor Description AttachmentService() -
Method Summary
Modifier and Type Method Description voiddelete(long attachmentId)voiddelete(Attachment attachment)List<Attachment>find(String creator)List<Attachment>find(String creator, String filename)List<Attachment>findAll(int offset, int maxresults)Attachmentget(long attachmentId)Attachmentget(String guid)IAttachmentDaogetAttachmentDao()IDocumentPersistenceStrategygetDocumentPersistenceStrategy()booleanisPersistenceIntoDatabaseRequired()Boolean indicating whether or not attachment data is stored into the database.Attachmentsave(Attachment attachment, String username, javax.servlet.http.HttpServletRequest request)Saves the metadata about the attachment to the database and persists the attachment to the configured documentPersistenceStrategy store.voidsetAttachmentDao(IAttachmentDao attachmentDao)voidsetDocumentPersistenceStrategy(IDocumentPersistenceStrategy documentPersistenceStrategy)protected voidupdateTimestamps(Attachment attachment, String user)
-
Constructor Details
-
AttachmentService
public AttachmentService()
-
-
Method Details
-
get
- Specified by:
getin interfaceIAttachmentService
-
get
- Specified by:
getin interfaceIAttachmentService
-
find
- Specified by:
findin interfaceIAttachmentService
-
find
- Specified by:
findin interfaceIAttachmentService
-
findAll
- Specified by:
findAllin interfaceIAttachmentService
-
save
public Attachment save(Attachment attachment, String username, javax.servlet.http.HttpServletRequest request)Description copied from interface:IAttachmentServiceSaves the metadata about the attachment to the database and persists the attachment to the configured documentPersistenceStrategy store.- Specified by:
savein interfaceIAttachmentService- Parameters:
attachment- Attachment to persistusername- username of the user uploading the documentrequest- HttpServlet request. Will be null with a data import operation- Returns:
- Updated attachment object
-
delete
- Specified by:
deletein interfaceIAttachmentService
-
delete
public void delete(long attachmentId)- Specified by:
deletein interfaceIAttachmentService
-
updateTimestamps
-
getAttachmentDao
-
setAttachmentDao
-
getDocumentPersistenceStrategy
-
setDocumentPersistenceStrategy
public void setDocumentPersistenceStrategy(IDocumentPersistenceStrategy documentPersistenceStrategy) -
isPersistenceIntoDatabaseRequired
public boolean isPersistenceIntoDatabaseRequired()Description copied from interface:IAttachmentServiceBoolean indicating whether or not attachment data is stored into the database. Some persistence stores, such as the local filesystem, would want the data stored into the database to allow for hydrating the data from the database in case it is not on the local file system. This is used when you have a cluster of portal servers and a server may not have the content hydrated locally. Other persistence stores, such as a network share or S3, store their data external to the portal server so there is no need to have the file data stored into a database.- Specified by:
isPersistenceIntoDatabaseRequiredin interfaceIAttachmentService- Returns:
- True if the file data is stored in the database, else false.
-