Class BasePortalContainerAttachmentsProvider
java.lang.Object
com.webmethods.caf.faces.bean.PageFlowScopeAdapter
com.webmethods.caf.faces.data.attachments.BasePortalContainerAttachmentsProvider
- All Implemented Interfaces:
IPageFlowScopeAdapter
,IAttachmentsProvider
,IWebDavAwareAttachmentsProvider
,Serializable
- Direct Known Subclasses:
PortalContainerAttachmentsProvider
,TempAttachmentsProvider
public class BasePortalContainerAttachmentsProvider
extends PageFlowScopeAdapter
implements IWebDavAwareAttachmentsProvider, Serializable
Base class for an attachments provider backed by a MWS
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected static final String
protected List<IAttachmentItem>
The list of attachment items in the containerprotected String
Holds the id of the container that contains the attachment filesprotected IThingID
ThingID of the containerThis structure is used bye#getMimeExtension
protected static final String
System property to override the config file locationprotected boolean
Flag to specify whether to use WebDAV or notFields inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter
fExpireWithPageFlow
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_listAttachments
(IThingID parentID) Builds the list of attachmentsprotected IContext
void
addAttachment
(org.apache.commons.fileupload.FileItem fileItem, String fileEncoding) Add Attachmentprotected String
Returns the attachments container idprotected IThingID
Returns the resolved container thingIDstatic String
getEncoding
(String mimeType) Returns encoding from mimeType string, null if not definedboolean
Returns whether the attachment provider has any attachmentsboolean
Returns whether attachments can be addedboolean
Returns whether to use webDAV URLs or notReturns a list of the current attachmentsvoid
refresh()
Refreshes the cached attachments listprotected void
releaseContext
(IContext context) void
removeAttachment
(String attachmentID) Remove Attachmentprotected void
setContainerID
(String containerID) Sets the attachments container idvoid
setUseWebDav
(boolean useWebDav) Sets whether to use webDAV URLsvoid
updateAttachment
(String attachmentID, org.apache.commons.fileupload.FileItem fileItem, String fileEncoding) Update an AttachmentMethods inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter
getExpireWithPageFlow, setExpireWithPageFlow
-
Field Details
-
fContainerID
Holds the id of the container that contains the attachment files -
fContainerThingID
ThingID of the container -
fAttachmentsList
The list of attachment items in the container -
useWebDav
protected boolean useWebDavFlag to specify whether to use WebDAV or not -
DEFAULT_MIME_PROPERTIES
- See Also:
-
MIME_CONFIG_FILE
System property to override the config file location- See Also:
-
m_mimeExtensions
This structure is used bye#getMimeExtension
-
CHARSET_EQUALS
- See Also:
-
-
Constructor Details
-
BasePortalContainerAttachmentsProvider
public BasePortalContainerAttachmentsProvider()
-
-
Method Details
-
getContainerID
Returns the attachments container id -
setContainerID
Sets the attachments container id- Parameters:
containerID
- the container id
-
getContainerThingID
Returns the resolved container thingID- Throws:
PortalException
-
refresh
public void refresh()Refreshes the cached attachments list- Specified by:
refresh
in interfaceIWebDavAwareAttachmentsProvider
-
isAddAttachmentsAvailable
public boolean isAddAttachmentsAvailable()Description copied from interface:IAttachmentsProvider
Returns whether attachments can be added- Specified by:
isAddAttachmentsAvailable
in interfaceIAttachmentsProvider
- Returns:
- true or false
-
addAttachment
Description copied from interface:IAttachmentsProvider
Add Attachment- Specified by:
addAttachment
in interfaceIAttachmentsProvider
- Parameters:
fileItem
- the attachment contentfileEncoding
- the encoding of the attachment file (if known)
-
removeAttachment
Description copied from interface:IAttachmentsProvider
Remove Attachment- Specified by:
removeAttachment
in interfaceIAttachmentsProvider
- Parameters:
attachmentID
- the id of the attachment to remove
-
updateAttachment
public void updateAttachment(String attachmentID, org.apache.commons.fileupload.FileItem fileItem, String fileEncoding) Description copied from interface:IAttachmentsProvider
Update an Attachment- Specified by:
updateAttachment
in interfaceIAttachmentsProvider
- Parameters:
attachmentID
- the id of the attachment to updatefileItem
- the new attachment contentfileEncoding
- the encoding of the attachment file (if known)
-
listAttachments
Description copied from interface:IAttachmentsProvider
Returns a list of the current attachments- Specified by:
listAttachments
in interfaceIAttachmentsProvider
- Returns:
- collection of AttachmentItems
-
_listAttachments
Builds the list of attachments- Parameters:
parentID
- the thingID of the parent container- Throws:
PortalException
-
getHasAttachments
public boolean getHasAttachments()Description copied from interface:IAttachmentsProvider
Returns whether the attachment provider has any attachments- Specified by:
getHasAttachments
in interfaceIAttachmentsProvider
- Returns:
- true or false
-
isUseWebDav
public boolean isUseWebDav()Description copied from interface:IWebDavAwareAttachmentsProvider
Returns whether to use webDAV URLs or not- Specified by:
isUseWebDav
in interfaceIWebDavAwareAttachmentsProvider
- Returns:
- true or false
-
setUseWebDav
public void setUseWebDav(boolean useWebDav) Description copied from interface:IWebDavAwareAttachmentsProvider
Sets whether to use webDAV URLs- Specified by:
setUseWebDav
in interfaceIWebDavAwareAttachmentsProvider
-
acquireContext
- Throws:
PortalException
-
releaseContext
-
getEncoding
Returns encoding from mimeType string, null if not defined- Parameters:
mimeType
-- Returns:
-