com.sap.caf.eu.gp.attachment.api

Interface IGPAttachmentList


public interface IGPAttachmentList

Represents a list of attachments defined for an entity. Such an entity may be an action, a block or a process defined in the design time.

An attachment list may be exposed by

The purpose of the attachment list is to provide a container that can be used by the design time and the run time to provide access to the available attachments but also to keep changes (e.g. new attachments, removal of attachments) in memory until the change will be eventually propagated to the persistence. The decision on how to handle this is up to the implementation of the attachment list.

Version:
1.0

Method Summary
 IGPAttachment add(String displayName, String originalFileName, String handlerName, String creator, byte[] content, boolean runtime)
          Adds a new attachment to the list.
 int count()
          Total count of attachments.
 Enumeration elements()
          Provides an enumeration for all available attachments.
 

Method Detail

count

int count()
Total count of attachments.

Returns:
attachment count

elements

Enumeration elements()
Provides an enumeration for all available attachments.

Returns:
attachment enumeration

add

IGPAttachment add(String displayName,
                  String originalFileName,
                  String handlerName,
                  String creator,
                  byte[] content,
                  boolean runtime)
                  throws GPInvocationException,
                         GPEngineException
Adds a new attachment to the list. It is up to the implementation of the attachment list for the specific store to determine whether or not it is necessary to immediately store the attachment in the database or whether or not it is stored in memory.

Note that the attachment id cannot be passed here because the actual implementation has to decide on the algorithm of creating an attachment id.

However, the attachment id must be generated immediately on invocation.

Parameters:
displayName - the display name of the attachment.
originalFileName - the original file name of the attchment.
handlerName - the name of the attachment handler.
creator - the unique id of the creator.
content - the actual content of the attachment.
runtime - attachment created by runtime (true) or design time (false)
Returns:
a reference to the new attachment object.
Throws:
InvocationException - if any of the parameters passed is invalid.
EngineException - if an error occurs while creating the attachment.
GPInvocationException
GPEngineException
See Also:
IAttachment


Copyright 2009 SAP AG Complete Copyright Notice