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

java.lang.Object
  extended by com.webmethods.caf.faces.data.attachments.AttachmentItem
      extended by com.webmethods.caf.faces.data.attachments.PortalAttachmentItem
All Implemented Interfaces:
IAttachmentItem, Serializable

public class PortalAttachmentItem
extends AttachmentItem

Implementation of com.webmethods.caf.faces.data.attachments.IAttachmentsItem interface that exposes a file stored in MWS as an attachment

See Also:
Serialized Form

Nested Class Summary
protected static class PortalAttachmentItem.PortalContentFileItem
          Implementation of FileItem from a file stored in MWS
 
Field Summary
 
Fields inherited from class com.webmethods.caf.faces.data.attachments.AttachmentItem
fContentLength, fContentType, fDeletable, fDownloadLink, fFileName, fIconUrl, fId, fUpdatable, lastModifiedDate
 
Constructor Summary
PortalAttachmentItem()
          Default Constructor
PortalAttachmentItem(String id, String fileName, String contentType, long contentLength, String downloadLink)
          Constructor
 
Method Summary
 FileItem getFileItem()
          Gets the FileItem representation of the attachment.
 String getIconUrl()
          Returns the icon url (may be null)
 boolean isDeletable()
          Returns whether the attachment is deletable by the current user
 boolean isUpdatable()
          Returns whether the attachment is updateable by the current user
 
Methods inherited from class com.webmethods.caf.faces.data.attachments.AttachmentItem
getContentLength, getContentType, getDownloadLink, getFileName, getId, getLastModifiedDate, setContentLength, setContentType, setDeletable, setDownloadLink, setFileName, setIconUrl, setId, setLastModifiedDate, setUpdatable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortalAttachmentItem

public PortalAttachmentItem()
Default Constructor


PortalAttachmentItem

public PortalAttachmentItem(String id,
                            String fileName,
                            String contentType,
                            long contentLength,
                            String downloadLink)
Constructor

Parameters:
id - Some unique identifier for the item within it's container. Each item in an attachment provider must have a unique id. The format of the id is up to the implementor. In the simple case, the id could be the same as the fileName.
fileName - The name of the attachment item.
contentType - The MIME type of the file content. http://en.wikipedia.org/wiki/Internet_media_type
contentLength - The length of the file (number of bytes).
downloadLink - The URL for downloading the file to a browser. The URL can be absolute (i.e. http://mysite/att/myfile.txt) or relative to some path in the webapp (i.e. /myappcontext/mycustomdownloadservlet/myfile.txt).
Method Detail

getIconUrl

public String getIconUrl()
Description copied from interface: IAttachmentItem
Returns the icon url (may be null)

Specified by:
getIconUrl in interface IAttachmentItem
Overrides:
getIconUrl in class AttachmentItem

isDeletable

public boolean isDeletable()
Description copied from interface: IAttachmentItem
Returns whether the attachment is deletable by the current user

Specified by:
isDeletable in interface IAttachmentItem
Overrides:
isDeletable in class AttachmentItem
Returns:
true or false

isUpdatable

public boolean isUpdatable()
Description copied from interface: IAttachmentItem
Returns whether the attachment is updateable by the current user

Specified by:
isUpdatable in interface IAttachmentItem
Overrides:
isUpdatable in class AttachmentItem
Returns:
true or false

getFileItem

public FileItem getFileItem()
                     throws IOException
Description copied from class: AttachmentItem
Gets the FileItem representation of the attachment. This implementation always returns null

Specified by:
getFileItem in interface IAttachmentItem
Overrides:
getFileItem in class AttachmentItem
Returns:
implementation of FileItem
Throws:
IOException