com.sap.netweaver.coll.attachment

Class AttachmentListManager

java.lang.Object
  extended by com.sap.netweaver.coll.attachment.AttachmentListManager
All Implemented Interfaces:
IAttachmentList

public class AttachmentListManager
extends Object
implements IAttachmentList

Interface for the Attachment List Object
Attachments are stored as Resources in the Repository "attachment".
Security is done by an AttachmentSecurityManager. Applications may set their own permissions at the Collection where attachments are stored (getAttachmentCollection()).
If assigned to Resources, permissions of the Resource are used.
Applications have to store the ID (getId()) to have further access to attachments.

Copyright (c) SAP AG 2002


Constructor Summary
AttachmentListManager()
          Constructor for the AttachmentControl object
AttachmentListManager(IRelation rel, String id)
          Constructor for the AttachmentControl object
 
Method Summary
 void addAttachment(IResource res)
          add IResource into AttachmentList (default is Link)
 void addAttachment(IResource res, AttachmentType type)
          add IResource into AttachmentList (default is Link)
 void addAttachment(com.sapportals.wcm.util.uri.RID uri, String name, IPropertyMap props)
          add RID to AttachmentList using name and properties
 void addAttachment(StringBuffer inBuffer, String name, IPropertyMap props)
          add content to AttachmentList using name and properties
 void delete()
          delete all Resources of this AttachmentList
 void deleteAttachment(IResource res)
          delete one Resource of the AttachmentList
 ICollection getAttachmentCollection()
          returns collection where attachments are stored (i.e. for use in Resourcelist-Control)
 int getAttachmentCount()
          returns number of attachment
 IResourceList getAttachments()
          returns IResourcelist containing all Resources
 AttachmentType getAttachmentType(IResource res)
          returns Attachmenttype of this IResource
 String getId()
          returns unique of AttachmentList
 HashMap getSupportedAttachmentTypes(IResource res)
          returns a List of supported Attachmenttypes for this IResource
 void setAttachmentType(IResource res, AttachmentType type)
          changes AttachmentTyp of this attachment-IResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentListManager

public AttachmentListManager()
Constructor for the AttachmentControl object


AttachmentListManager

public AttachmentListManager(IRelation rel,
                             String id)
Constructor for the AttachmentControl object

Parameters:
context - Resourcecontext
path - Path to Collection of Attachments
id - Unique ID
Method Detail

getId

public String getId()
returns unique of AttachmentList

Specified by:
getId in interface IAttachmentList
Returns:
String containing unique ID of AttachmentList

getAttachments

public IResourceList getAttachments()
                             throws AttachmentException
returns IResourcelist containing all Resources

Specified by:
getAttachments in interface IAttachmentList
Returns:
IResourceList
Throws:
NoAttachmentCollectionException
AttachmentException

delete

public void delete()
            throws AttachmentException
delete all Resources of this AttachmentList

Specified by:
delete in interface IAttachmentList
Throws:
AttachmentException

deleteAttachment

public void deleteAttachment(IResource res)
                      throws AttachmentException
delete one Resource of the AttachmentList

Specified by:
deleteAttachment in interface IAttachmentList
Throws:
AttachmentException

addAttachment

public void addAttachment(IResource res)
                   throws AttachmentException
add IResource into AttachmentList (default is Link)

Specified by:
addAttachment in interface IAttachmentList
Parameters:
res - IResource to be added
Throws:
com.sapportals.wcm.WcmException
AttachmentException

addAttachment

public void addAttachment(IResource res,
                          AttachmentType type)
                   throws AttachmentException
add IResource into AttachmentList (default is Link)

Specified by:
addAttachment in interface IAttachmentList
Parameters:
res - IResource to be added
type - add as Attachmenttype (i.e. copy, link, ..)
Throws:
AttachmentException

addAttachment

public void addAttachment(com.sapportals.wcm.util.uri.RID uri,
                          String name,
                          IPropertyMap props)
                   throws AttachmentException
add RID to AttachmentList using name and properties

Specified by:
addAttachment in interface IAttachmentList
Parameters:
uri - RID of Resource to be added
name - Name of the Resource
props - Properties of the attachment
Throws:
com.sapportals.wcm.WcmException
AttachmentException

addAttachment

public void addAttachment(StringBuffer inBuffer,
                          String name,
                          IPropertyMap props)
                   throws AttachmentException
add content to AttachmentList using name and properties

Specified by:
addAttachment in interface IAttachmentList
Parameters:
content - content of new attachment
name - Name of the Resource
props - Properties of the attachment
Throws:
com.sapportals.wcm.WcmException
AttachmentException

getAttachmentCollection

public ICollection getAttachmentCollection()
returns collection where attachments are stored (i.e. for use in Resourcelist-Control)

Specified by:
getAttachmentCollection in interface IAttachmentList
Returns:
ICollection
Throws:
com.sapportals.wcm.WcmException

getAttachmentCount

public int getAttachmentCount()
                       throws AttachmentException
returns number of attachment

Specified by:
getAttachmentCount in interface IAttachmentList
Returns:
number of attachments (might be 0)
Throws:
AttachmentException

getSupportedAttachmentTypes

public HashMap getSupportedAttachmentTypes(IResource res)
returns a List of supported Attachmenttypes for this IResource

Specified by:
getSupportedAttachmentTypes in interface IAttachmentList
Parameters:
res - IResource to be checked
Returns:
List of Attachmenttypes
Throws:
com.sapportals.wcm.WcmException

getAttachmentType

public AttachmentType getAttachmentType(IResource res)
                                 throws AttachmentException
returns Attachmenttype of this IResource

Specified by:
getAttachmentType in interface IAttachmentList
Parameters:
res - IResource to be checked
Returns:
Attachmenttype
Throws:
com.sapportals.wcm.WcmException
AttachmentException

setAttachmentType

public void setAttachmentType(IResource res,
                              AttachmentType type)
                       throws AttachmentException
changes AttachmentTyp of this attachment-IResource

Specified by:
setAttachmentType in interface IAttachmentList
Parameters:
res - attachment-IResource to be changed
target - Attachmenttype
Throws:
com.sapportals.wcm.WcmException
AttachmentException


Copyright 2011 SAP AG Complete Copyright Notice