com.webmethods.caf.faces.data.attachments
Class BasePortalContainerAttachmentsProvider

java.lang.Object
  extended by com.webmethods.caf.faces.bean.PageFlowScopeAdapter
      extended by 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:
Serialized Form

Field Summary
protected  List 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  boolean useWebDav
          Flag to specify whether to use WebDAV or not
 
Fields inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter
fExpireWithPageFlow
 
Constructor Summary
BasePortalContainerAttachmentsProvider()
           
 
Method Summary
protected  void _listAttachments(IThingID parentID)
          Builds the list of attachments
protected  IContext acquireContext()
           
 void addAttachment(FileItem fileItem, String fileEncoding)
          Add Attachment
protected  String getContainerID()
          Returns the attachments container id
protected  IThingID getContainerThingID()
          Returns the resolved container thingID
 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 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, FileItem fileItem, String fileEncoding)
          Update an Attachment
 
Methods inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter
getExpireWithPageFlow, setExpireWithPageFlow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fContainerID

protected String fContainerID
Holds the id of the container that contains the attachment files


fContainerThingID

protected transient IThingID fContainerThingID
ThingID of the container


fAttachmentsList

protected List fAttachmentsList
The list of attachment items in the container


useWebDav

protected boolean useWebDav
Flag to specify whether to use WebDAV or not

Constructor Detail

BasePortalContainerAttachmentsProvider

public BasePortalContainerAttachmentsProvider()
Method Detail

getContainerID

protected String getContainerID()
Returns the attachments container id


setContainerID

protected void setContainerID(String containerID)
Sets the attachments container id

Parameters:
containerID - the container id

getContainerThingID

protected IThingID getContainerThingID()
                                throws PortalException
Returns the resolved container thingID

Throws:
PortalException

refresh

public void refresh()
Refreshes the cached attachments list

Specified by:
refresh in interface IWebDavAwareAttachmentsProvider

isAddAttachmentsAvailable

public boolean isAddAttachmentsAvailable()
Description copied from interface: IAttachmentsProvider
Returns whether attachments can be added

Specified by:
isAddAttachmentsAvailable in interface IAttachmentsProvider
Returns:
true or false

addAttachment

public void addAttachment(FileItem fileItem,
                          String fileEncoding)
Description copied from interface: IAttachmentsProvider
Add Attachment

Specified by:
addAttachment in interface IAttachmentsProvider
Parameters:
fileItem - the attachment content
fileEncoding - the encoding of the attachment file (if known)

removeAttachment

public void removeAttachment(String attachmentID)
Description copied from interface: IAttachmentsProvider
Remove Attachment

Specified by:
removeAttachment in interface IAttachmentsProvider
Parameters:
attachmentID - the id of the attachment to remove

updateAttachment

public void updateAttachment(String attachmentID,
                             FileItem fileItem,
                             String fileEncoding)
Description copied from interface: IAttachmentsProvider
Update an Attachment

Specified by:
updateAttachment in interface IAttachmentsProvider
Parameters:
attachmentID - the id of the attachment to update
fileItem - the new attachment content
fileEncoding - the encoding of the attachment file (if known)

listAttachments

public List listAttachments()
Description copied from interface: IAttachmentsProvider
Returns a list of the current attachments

Specified by:
listAttachments in interface IAttachmentsProvider
Returns:
collection of AttachmentItems

_listAttachments

protected void _listAttachments(IThingID parentID)
                         throws PortalException
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 interface IAttachmentsProvider
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 interface IWebDavAwareAttachmentsProvider
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 interface IWebDavAwareAttachmentsProvider

acquireContext

protected IContext acquireContext()
                           throws PortalException
Throws:
PortalException

releaseContext

protected void releaseContext(IContext context)