Attachment Attributes

The attachments that you add to your processes at Guided Procedures (GP) design time and runtime have a set of attributes, which you can access using the GP API.

An attachment is always associated with the following attributes:

  • ID - a unique identifier of the attachment, generated depending on the particular implementation of the attachment list
  • Display name - the visible name
  • Original file name - the name of the file attached
  • Type handler

    A number of attachment handlers are available within the GP framework:

    • File ( TYPE_FILE )
    • URL ( TYPE_URL )
    • User management handler ( TYPE_USER )

    Currently, you cannot register any additional handlers.

  • Creator - the ID of the person who created the attachment

    This is the unique ID, returned by the User Management Engine (UME), which helps the GP framework to recognize and visualize the user.

  • Date of creation
  • Row byte content - the content of the file in bytes
  • A flag indicating if it is a runtime attachment

You can access these attributes with the following methods:

 
publicString getId();
publicString getDisplayname();
publicString getOriginalFileName();
publicString getHandler();
publicString getCreator();
publicDate getCreated();
publicbyte[] getContent() throws GPEngineException;
publicboolean isRuntime();
The information that can be used to visualize an attachment is stored in the
GPAttachmentInfo
class.

importcom.sap.caf.eu.gp.attachment.api.IGPAttachmentSourceHandler;
 
GPAttachmentInfo info = IGPAttachmentSourceHandler.resolveAttachmentInfo(attachment,locale);
The available attributes of the
GPAttachmentInfo
are:
  • Display name
  • Tooltip text
  • Date of creation
  • Creator
  • Icon URL - the URL of the icon used
  • Display URL - the URL used to display the attachment
  • Display mode
    • Download (
      DISPLAY_MODE_DOWNLOAD
      ) - the attachment is displayed with the download option
    • URL (
      DISPLAY_MODE_URL
      ) - the attachment is displayed by opening an external URL
  • Reference to the attachment itself

You can access the attributes with the following methods:

 
publicString getDisplayName();
publicString getTooltipText();
publicDate getCreationDate();
publicString getCreator();
publicString getIconUrl();
publicString getDisplayUrl();
publicint getDisplayMode();
publicIGPAttachment getAttachment();