public class BasePortalContainerAttachmentsProvider extends PageFlowScopeAdapter implements IWebDavAwareAttachmentsProvider, Serializable
Modifier and Type | Field and Description |
---|---|
static String |
CHARSET_EQUALS |
protected static String |
DEFAULT_MIME_PROPERTIES |
protected List<IAttachmentItem> |
fAttachmentsList
The list of attachment items in the container
|
protected String |
fContainerID
Holds the id of the container that contains the attachment files
|
protected IThingID |
fContainerThingID
ThingID of the container
|
protected static HashMap<String,String> |
m_mimeExtensions
This structure is used bye
#getMimeExtension |
protected static String |
MIME_CONFIG_FILE
System property to override the config file location
|
protected boolean |
useWebDav
Flag to specify whether to use WebDAV or not
|
fExpireWithPageFlow
Constructor and Description |
---|
BasePortalContainerAttachmentsProvider() |
Modifier and Type | Method and Description |
---|---|
protected void |
_listAttachments(IThingID parentID)
Builds the list of attachments
|
protected IContext |
acquireContext() |
void |
addAttachment(org.apache.commons.fileupload.FileItem fileItem,
String fileEncoding)
Add Attachment
|
protected String |
getContainerID()
Returns the attachments container id
|
protected IThingID |
getContainerThingID()
Returns the resolved container thingID
|
static String |
getEncoding(String mimeType)
Returns encoding from mimeType string, null if not defined
|
boolean |
getHasAttachments()
Returns whether the attachment provider has any attachments
|
boolean |
isAddAttachmentsAvailable()
Returns whether attachments can be added
|
boolean |
isUseWebDav()
Returns whether to use webDAV URLs or not
|
List<IAttachmentItem> |
listAttachments()
Returns a list of the current attachments
|
void |
refresh()
Refreshes the cached attachments list
|
protected void |
releaseContext(IContext context) |
void |
removeAttachment(String attachmentID)
Remove Attachment
|
protected void |
setContainerID(String containerID)
Sets the attachments container id
|
void |
setUseWebDav(boolean useWebDav)
Sets whether to use webDAV URLs
|
void |
updateAttachment(String attachmentID,
org.apache.commons.fileupload.FileItem fileItem,
String fileEncoding)
Update an Attachment
|
getExpireWithPageFlow, setExpireWithPageFlow
protected String fContainerID
protected transient IThingID fContainerThingID
protected List<IAttachmentItem> fAttachmentsList
protected boolean useWebDav
protected static final String DEFAULT_MIME_PROPERTIES
protected static final String MIME_CONFIG_FILE
protected static HashMap<String,String> m_mimeExtensions
#getMimeExtension
public static final String CHARSET_EQUALS
public BasePortalContainerAttachmentsProvider()
protected String getContainerID()
protected void setContainerID(String containerID)
containerID
- the container idprotected IThingID getContainerThingID() throws PortalException
PortalException
public void refresh()
refresh
in interface IWebDavAwareAttachmentsProvider
public boolean isAddAttachmentsAvailable()
IAttachmentsProvider
isAddAttachmentsAvailable
in interface IAttachmentsProvider
public void addAttachment(org.apache.commons.fileupload.FileItem fileItem, String fileEncoding)
IAttachmentsProvider
addAttachment
in interface IAttachmentsProvider
fileItem
- the attachment contentfileEncoding
- the encoding of the attachment file (if known)public void removeAttachment(String attachmentID)
IAttachmentsProvider
removeAttachment
in interface IAttachmentsProvider
attachmentID
- the id of the attachment to removepublic void updateAttachment(String attachmentID, org.apache.commons.fileupload.FileItem fileItem, String fileEncoding)
IAttachmentsProvider
updateAttachment
in interface IAttachmentsProvider
attachmentID
- the id of the attachment to updatefileItem
- the new attachment contentfileEncoding
- the encoding of the attachment file (if known)public List<IAttachmentItem> listAttachments()
IAttachmentsProvider
listAttachments
in interface IAttachmentsProvider
protected void _listAttachments(IThingID parentID) throws PortalException
parentID
- the thingID of the parent containerPortalException
public boolean getHasAttachments()
IAttachmentsProvider
getHasAttachments
in interface IAttachmentsProvider
public boolean isUseWebDav()
IWebDavAwareAttachmentsProvider
isUseWebDav
in interface IWebDavAwareAttachmentsProvider
public void setUseWebDav(boolean useWebDav)
IWebDavAwareAttachmentsProvider
setUseWebDav
in interface IWebDavAwareAttachmentsProvider
protected IContext acquireContext() throws PortalException
PortalException
protected void releaseContext(IContext context)