My Oracle Support Banner

Oracle Agile 9.3.4 Java SDK Getting And Adding Documents To Change Is Renaming File To SDK (Doc ID 2878332.1)

Last updated on JULY 05, 2022

Applies to:

Oracle Agile PLM Framework - Version 9.3.4.0 and later
Information in this document applies to any platform.

Symptoms

After adding an attachment to a change, the attachment is automatically named "SDK."

 

Steps to reproduce:

  1. Run the following code to add an attachment:
    // First, get an attachment file
    private InputStream getDocument(IAgileSession session) {
    // Get DOC018002 Restricting attachments.docx
    InputStream isFile = null;
    // Get item DOC018002
    IItem item = (IItemsession.getObject(IItem.OBJECT_TYPE"DOC018002");
    // Get the attachment table for file attachments
    ITable attTable = item.getAttachments();
    // Get a table iterator
    ITwoWayIterator it = attTable.getTableIterator();
    // Get the first attachment in the table
    if (it.hasNext()) {
    IRow row = (IRow)it.next();
    // Read the contents of the stream
    isFile = ((IAttachmentFile)row).getFile();
    }else {
    if (logger.isDebugEnabled()) logger.debug(loggerPrefix + "No file);
    }
    // Second, add the file as attachment
    private void addAttachments(IChange chgIAgileSession session, InputStream 
    fileCoordDocIS) {
    // Get Change
    IChange itemChg = (IChange) session.getObject(IChange.OBJECT_TYPEchg.getName());
    // Get the attachment table for file attachments
    ITable attTableChg = itemChg.getTable(ItemConstants.TABLE_ATTACHMENTS);
    IRow rowChg = attTableChg.createRow(fileCoordDocIS);
    }
  2. The newly added attachment is shown as SDK in filename column.

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.